Anaconda环境软件包更新

Anaconda环境软件包更新

本文介绍了Anaconda环境软件包更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我以root用户身份执行完整的anaconda安装,该安装将在所有用户之间共享.

Let's assume I perform a full anaconda installation as root that will be shared among all users.

a.在 base 环境中,我安装python2.7.12,matplotlib和numpy:

a. On the base environment I install python2.7.12, matplotlib and numpy:

$ conda install python=2.7.12 matplotlib numpy

b.几个月后,我的一个用户创建了一个环境:

b. After a couple of months one of my users creates an environment:

$ conda install -n py27 python=2.7.12 matplotlib numpy

我们假设与此同时,matplotlib和numpy已更新,并且不再使用同一版本.

Let's assume that in the meanwhile a matplotlib and numpy were updated and are no longer on the same version.

我的问题是:

  1. a)中安装的matplotlib和numpy的版本会自动更新为最新版本吗?

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

b)中创建环境时,安装了哪些版本的matplotlib和numpy?最新的还是在 a)的基本环境中安装的??

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)?

之所以这样问,是因为我试图在最小化磁盘占用的同时实现共享的anaconda环境.基本上,原因是避免为每个用户安装不同的anaconda,并避免使用20个不同版本的matplotlib和numpy(以及其他版本)占用磁盘空间.

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.

谢谢.

推荐答案

a.)安装的软件包的版本不会自动更新,仅当您通过软件包管理器明确发出更新命令时,软件包才会更新

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.)创建新环境并尝试再次安装软件包时,默认情况下,它将安装最新的软件包(该软件包可能与基本环境中存在的软件包不匹配)

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)

编辑-我想使用 requirements.txt 文件是确保所有人使用相同版本的已安装库的更好方法.

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

例如:pip install 'package_name==version_number'

这篇关于Anaconda环境软件包更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 23:53