Anaconda environments packages update

不羁岁月 提交于 2020-04-11 12:18:29

问题


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:

  1. will the versions of matplotlib and numpy installed in a) be automatically updated to the latest?

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!