how to reuse global site-packages in conda env

Viewed 16090

I have a project called ABC, I have a conda env just for it in the fold ~/anaconda/envs/ABC, I believe it is a venv, and I want to use some specific packages from the global site packages.

For normal Python installation it can be done be removing the no-global-site-package.txt from the venv folder, or by setting the venv to use global-site-packages, but I didn't find any equivalent approach to do this in Anaconda. The online documentation does not have answer either.

How to do this for Anaconda?

3 Answers

In case anyone is coming back to this now, for conda 4.7.12, entering export PYTHONNOUSERSITE=True before the conda activate call successfully isolated the conda environment from global/user site packages for me.

On the other hand, entering export PYTHONNOUSERSITE=0 allows the conda environment to be reintroduced to the global/user site packages.

Note: This is instead of the previously suggested export PYTHONNOUSERSITE=1.

Related