问题
Let's assume I perform a full anaconda installation as root that will be shared among all users.
a. On the base environment I install python2.7.12, matplotlib and numpy:
$ conda install python=2.7.12 matplotlib numpy
b. After a couple of months one of my users creates an environment:
$ conda install -n py27 python=2.7.12 matplotlib numpy
Let's assume that in the meanwhile a matplotlib and numpy were updated and are no longer on the same version.
My questions are:
will the versions of matplotlib and numpy installed in a) be automatically updated to the latest?
when the environment is created in b), which versions of matplotlib and numpy are installed? the latest ones or the ones that were installed on the base environment in a)?
The reason I am asking this is because I attempting to implement a shared anaconda environment while minimizing the disk footprint. Basically, the reason is to avoid having for each user a different installation of anaconda and avoid having 20 different versions of matplotlib and numpy (among many others) taking up disk space.
Thanks.
回答1:
a.) The versions of installed packages will not be updated automatically , packages are only updated when you explicitly issue the update commands with your package manager
b.) When a new environment is created and you try to install packages again , by default it will install the latest package (which may not match with whatever is present on your base environment)
Edit - I would like to comment that using a requirements.txt file is a much better way to ensure everyone uses the same versions of the installed libraries.
or else you can make sure everyone mentions the version numbers along with the install command
eg : pip install 'package_name==version_number'
来源:https://stackoverflow.com/questions/51658582/anaconda-environments-packages-update