xoux
xoux

Reputation: 3494

Difference between Spyder IPython and "normal" IPython sys.path

There are some modules I want to be able to import when I use IPython. I use IPython from the command line sometimes, and I also use IPython from Anaconda Spyder sometimes. I appended the PYTHONPATH environment variable in my .bashrc file to include the directory that contains the modules I want to import.

Now, when I start IPython at the command line, everything works fine. If I import sys, and type sys.path, the new directory I included is there.

However, when I do the same thing in Anaconda Spyder's Ipython, the sys.path is slightly different (has some extra directories) and does not contain the newly added directory with my modules.

Why is this?

Upvotes: 1

Views: 2012

Answers (1)

alain
alain

Reputation: 657

.bashrc is read by "interactive" shells (when you start your terminal containing bash). Running Anaconda Spyder's Ipython doesn't start any interactive shell.

You have to setup your PYTHONPATH on "login" by specifying it in your .profile (you'll have to logout/login to make chages effective).

Upvotes: 1

Related Questions