26

I installed Anaconda and created a new env ("dell_proj"). Then I created a new Project in Pycharm with my new environment. My expectation was that I would only be able to use packages in this project that I installed through Conda in that specific env, however, I am able to use all packages that were installed in the Base environment.

Packages shown available in Conda for env

Packages shown available in Pycharm for env

Could somebody explain what I'm misunderstanding here?

Jeff Bagley
  • 435
  • 1
  • 5
  • 8

3 Answers3

20

You can create a clone of the base environment using conda create --name dell_proj --clone base. This will create a new environment that is a copy of your base environment.

If you created the new environment using something like conda create --name dell_proj, it will not inherit packages from the base environment. You would have to install the packages you want using conda install.

IqbalHamid
  • 2,324
  • 1
  • 18
  • 24
haxtar
  • 1,962
  • 3
  • 20
  • 44
8

In windows you create an environment without specifying the python version, then it will create the new environment with all packages in base. I don't know if it is a bug or a feature but this works in windows.

conda create -n new_env

creates an environment with base packages

conda create -n new_env python=3.7 

creates new environment only with some necessary packages given below

ca-certificates    
certifi            
openssl            
pip                
python             
setuptools         
sqlite             
vc                 
vs2015_runtime     
wheel              
wincertstore       
codeslord
  • 2,172
  • 14
  • 20
  • This no longer appears to be true on WIndows 10; creating a `new_env` as specified creates an environment with nothing in it. Running e.g. `spyder` from within the new environment is not recognized :( – EHB Mar 19 '20 at 23:57
0

I am using Anaconda x64-4.4.0 with Python 3. I created a new Python 2 environment, and it only imported a few basic packages. So it would seem the answer depends on how the environment was created.

smp55
  • 403
  • 3
  • 8