Selah
Selah

Reputation: 8074

modified PYTHONPATH not recognized by Anaconda Spyder

I use my .bash_profile to add a directory to PYTHONPATH

export PYTHONPATH="${PYTHONPATH}:/Users/selah/newdir"

In my Anaconda installation of Spyder the path I added does not show up when I type:

import sys
sys.paths

However when i do the same in Jupyter notebook, or terminal python it does show up.

Why the discrepancy? Is there a way to get Spyder to recognize my modified PYTHONPATH?

Upvotes: 1

Views: 7097

Answers (2)

jamalin
jamalin

Reputation: 76

I had a similar problem. For future reference, resolved by adding path under menu “python > PYTHONPATH manager” option.

Upvotes: 2

Carlos Cordoba
Carlos Cordoba

Reputation: 34186

(Spyder developer here) You need to start Spyder from the command line for your changes to be detected by Spyder.

This is because Spyder doesn't have a way to read your environment variables when started in a graphical way.

Upvotes: 3

Related Questions