Reputation: 8074
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
Reputation: 76
I had a similar problem. For future reference, resolved by adding path under menu “python > PYTHONPATH manager” option.
Upvotes: 2
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