Reputation: 173
I'm trying to remove an environment foo with the command:
conda remove -n foo --all --dry-run
which shows that these packages will be removed:
The following packages will be REMOVED:
certifi: 2016.2.28-py27_0
mkl: 2017.0.3-0
numpy: 1.13.1-py27_0
openssl: 1.0.2l-vc9_0 [vc9]
pip: 9.0.1-py27_1
python: 2.7.13-1
scipy: 0.19.1-np113py27_0
setuptools: 36.4.0-py27_1
sqlite: 3.13.0-vc9_1 [vc9]
tk: 8.5.18-vc9_0 [vc9]
vs2008_runtime: 9.00.30729.5054-0
wheel: 0.29.0-py27_0
wincertstore: 0.2-py27_0
zlib: 1.2.11-vc9_0 [vc9]
DryRunExit: Dry run exiting
But I also have a different important environment bar whose packages I want to keep (and other environments that probably share packages with it):
C:\WINDOWS\system32>conda remove -n bar --all --dry-run
Remove all packages in environment C:\Users\blah\Anaconda3\envs\bar:
## Package Plan ##
environment location: C:\Users\blah\Anaconda3\envs\bar
The following packages will be REMOVED:
backports: 1.0-py27_0
beautifulsoup4: 4.5.1-py27_0
boto: 2.43.0-py27_0
bz2file: 0.98-py27_0
click: 6.6-py27_0
configparser: 3.5.0-py27_0
curl: 7.49.0-vc9_0 [vc9]
cycler: 0.10.0-py27_0
django: 1.10.3-py27_0
flask: 0.11.1-py27_0
gensim: 0.12.4-np111py27_0
icu: 57.1-vc9_0 [vc9]
itsdangerous: 0.24-py27_0
jinja2: 2.8-py27_1
jpeg: 8d-vc9_2 [vc9]
libpng: 1.6.22-vc9_0 [vc9]
lxml: 3.6.4-py27_0
markupsafe: 0.23-py27_2
matplotlib: 1.5.3-np111py27_1
mkl: 11.3.3-1
mysql-connector-python: 2.0.4-py27_0
nltk: 3.2.1-py27_0
numpy: 1.11.2-py27_0
openssl: 1.0.2j-vc9_0 [vc9]
pandas: 0.19.1-np111py27_0
pip: 9.0.1-py27_0
pymysql: 0.7.9-py27_0
pyparsing: 2.1.4-py27_0
pyqt: 5.6.0-py27_0
python: 2.7.12-0
python-dateutil: 2.6.0-py27_0
pytz: 2016.7-py27_0
qt: 5.6.0-vc9_0 [vc9]
requests: 2.12.1-py27_0
scipy: 0.18.1-np111py27_0
setuptools: 27.2.0-py27_1
sip: 4.18-py27_0
six: 1.10.0-py27_0
smart_open: 1.3.5-py27_0
tk: 8.5.18-vc9_0 [vc9]
vs2008_runtime: 9.00.30729.1-2
werkzeug: 0.11.11-py27_1
wheel: 0.29.0-py27_0
yaml: 0.1.6-0
zlib: 1.2.8-vc9_3 [vc9]
Notice that, for example, tk: 8.5.18-vc9_0 [vc9] is in both. If I remove all packages in foo will packages being used in bar also be removed? How do I remove the packages exclusively used by foo?
Upvotes: 1
Views: 543
Reputation: 19597
No, conda will not remove packages from other environments if they are removed in one environment. Conda stores the main version of each package in the pkgs
directory, and links the files in that directory into each environment. When you remove an environment, conda simply removes the links associated with that environment, while leaving the main version of each package unchanged.
Upvotes: 1