Add directory to Python path in PyCharm?

You can add custom paths this way. Go to File->Settings->project Interpreter In the Project-Interpreter field, click the down facing arrow and select “show All” In that Menu, highlight your interpreter and then in the right menu, select the button “Show paths for the selected interpreter” (this is the last button) click the plus symbol to … Read more

PYTHONPATH not working for sudo on GNU/Linux (works for root)

The same is true for the PATH variable, it’s also not carried into the super user environment, even though you’re passing the preserve environment flag -E. I’m using this sudo command now without any other modifications: sudo -HE env PATH=$PATH PYTHONPATH=$PYTHONPATH ./bin/myscript Since it’s an alternative approach that works (for me) I thought I’d share … Read more

Anaconda: Permanently include external packages (like in PYTHONPATH)

I found two answers to my question in the Anaconda forum: 1.) Put the modules into into site-packages, i.e. the directory $HOME/path/to/anaconda/lib/pythonX.X/site-packages which is always on sys.path. This should also work by creating a symbolic link. 2.) Add a .pth file to the directory $HOME/path/to/anaconda/lib/pythonX.X/site-packages. This can be named anything (it just must end with … Read more