Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my conda environment inherits all base packages?

I am trying to create a "clean" Python virtual environment using conda:

conda create -n somename python=3.7 --no-default-packages

But somehow I have access to all the packages installed in base inside this environment. pip list returns all the Python packages, and I can import those packages in Python. However, the actual environment's "site-packages" folder does not contain those extra Python modules as the base folder does.

So what should I do to create an independent/separate virtual environment? I am using Windows10.


I had PYTHONPATH/HOME explicitly specified in path, after deleting now it works good.
like image 905
n33 Avatar asked Sep 15 '25 09:09

n33


1 Answers

It sounds silly, but make sure that you are actually activating the new environment. Also make sure to check that which python and which pip refer to the new environment, I've had problems before where tmux makes conda activations silently fail.

like image 77
sgillen Avatar answered Sep 17 '25 23:09

sgillen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!