0

I am on a linux system that only has Python 2.7 installed globally. I have installed Anaconda with Python 3.5 in my home folder. I also installed the latest version of IPython using conda install ipython. When running ipython at the console, I get:

Traceback (most recent call last):
  File "/home/mateinfo/vlad/anaconda3/bin/ipython", line 4, in <module>
    import IPython
  File "/home/mateinfo/vlad/anaconda3/lib/python3.5/site-packages/IPython/__init__.py", line 49, in <module>
    from .terminal.embed import embed
  File "/home/mateinfo/vlad/anaconda3/lib/python3.5/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.core.interactiveshell import DummyMod, InteractiveShell
  File "/home/mateinfo/vlad/anaconda3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 31, in <module>
    from pickleshare import PickleShareDB
  File "/home/mateinfo/vlad/anaconda3/lib/python3.5/site-packages/pickleshare.py", line 41, in <module>
    from path import path as Path
  File "/opt/pcm/lib/python/path.py", line 919
    def mkdir(self, mode=0777):

As far as I can tell, the problem is with the used path module, which seems to be from Python 2.7, since it uses the old octal format 0777.

How can I get IPython working under this setup?

I have this in my .bashrc:

# added by Anaconda3 4.0.0 installer
export PATH="/home/mateinfo/vlad/anaconda3/bin:$PATH"
export PATH="/home/mateinfo/vlad/anaconda3/lib:$PATH"
export PATH="/home/mateinfo/vlad/anaconda3/lib/python3.5:$PATH"

Only the first line was added by the Anaconda installer, the other 2 were added by me, with no success.

3
  • The only line needed is the bin folder. Nothing more. The problem lays somewhere else. Commented Aug 7, 2016 at 13:38
  • 1
    Do you have a PYTHONPATH set? If yes, do unset PYTHONPATH Commented Aug 7, 2016 at 13:39
  • @MaxNoe that was it. I had no idea it was set though. If you'll make an answer out of it I'll accept it, thanks. Commented Aug 7, 2016 at 13:43

1 Answer 1

1

You might have the PYTHONPATH environment variable set to a location where a python2 library resides.

As general recommendation, never use this variable. Create proper setup.py scripts for your libraries.

To get rid of it, you can do unset PYTHONPATH or eliminate anything that sets this variable in your .bashrc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.