Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add folder to search path for a given Anaconda environment?

I am developing a project in Python and I want to include some own modules which are not on the regular Python search path and I want to add them. However, I want to do this just for the Anaconda environment I am using during development and I would like them to remain there over time(i.e. when I restart the environment, I want the search path to have that folder).

Thanks!

like image 926
Radu Szasz Avatar asked Sep 22 '15 11:09

Radu Szasz


People also ask

How do you find the path of the conda environment?

Environments created with conda , by default, live in the envs/ folder of your miniconda3 (or anaconda3 ) directory the absolute path to which will look something the following: /Users/$USERNAME/miniconda3/envs or C:\Users\$USERNAME\Anaconda3 . You can see the location of your conda environments by running the command.


1 Answers

You can use

conda develop <directory>

This will write a conda.pth file to the environment's site-packages directory which will cause your directory to be added to the sys.path.

like image 176
asmeurer Avatar answered Oct 17 '22 22:10

asmeurer