This gives you the best of both worlds: most of the time you are just creating a new, reproducible environment from the locked dependency file. When creating an environment, you use the locked dependency file.You use the versioned direct file to generate the locked dependency file.Let’s summarize what we’ve learned about the three kinds of dependency specifications: Dependency specificationīut we can get both reproducibility and upgradability by having two files. So we now have reproducibility, but upgrades are quite difficult, perhaps even impossible without starting from scratch. at this point there are pages and pages of output. Output in format: Requested package -> Available versions UnsatisfiableError: The following specifications were found to be incompatible with each other: $ conda env create -n example2 -f Ĭollecting package metadata (repodata.json): doneįound conflicts! Looking for incompatible packages. This is the “transitively-pinned” or “locked” dependency list, which you can create with conda env export: Once you that environment with all the dependencies installed, you can create new environment.yml that has the exact versions of all dependencies, including dependencies of dependencies. Transitively-pinned dependencies, aka locked dependencies On the other hand, upgrades are still pretty easy: to switch to Python 3.9, just change the version of Python. Ld_impl_linux-64 2.35.1 hed1e6ac_0 conda-forgeĪll of those dependencies might change out from under you whenever you recreate the environment.įor example, if you installed NumPy 1.19 this time, the next time you install you might get NumPy 1.20, which in theory could have a bug that changes Pandas’ results. # packages in environment at /home/itamarst/.conda/envs/example: We can add a version specifier to Python, Pandas, or both. Given how bad our environment.yml is at reproducible installs, we can constrain what it installs a little. On the flip side, from the perspective of the packaging infrastructure upgrades are trivial to achieve: they happen automatically every time you recreate your environment. Similarly, there might be a new version of Python, which can also cause problems. If you have to recreate the environment, it will install the latest version of Pandas: you might get different results, or maybe your code won’t run at all.
0 Comments
Leave a Reply. |