4

After activating my anaconda Python 3.6 environment with

source activate py36

if I type

python

I go into python 3.6, as expected. But if I type

ipython

I go into an ipython environment based python 3.5.5, which is the same python version I get using

source activate base

and then

python

How can I get into an ipython environment using my anaconda-supplied python 3.6 interpreter? I have updated my anaconda environment with

conda update anaconda

and

conda update conda

Doing so does not help.

EDIT:

I hadn't realized that I had to install ipython separately for the python 3.6 environment; I'd thought it was a default part of anaconda. So

conda install ipython

after

source activate py36

did the trick. It doesn't seem optimal that after activating a particular environment, ipython may bring up a completely different anaconda-based environment. I'd prefer it to simply cause a "command not found" error. Bringing up the wrong environment without making it very obvious that that is happening could lead to confusion or problems.

2 Answers 2

5

I hadn't realized that I had to install ipython separately for the python 3.6 environment; I'd thought it was a default part of anaconda. So

conda install ipython

after

source activate py36

did the trick.

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

Comments

2

Have you done hash -r since entering the conda environment? Bash can cache paths to executables, so sometimes it doesn't use the one reported by which. Running hash -r resets the cache

Maybe you need also to update ipython conda update ipython

1 Comment

hash -r doesn't help, and when I do conda update ipython, it says "All requested packages already installed". I don't know if it's relevant, but I can't run conda update if I've activated my python 3.6 environment; I have to do "source activate base" before I can successfully run it. Otherwise I get the error "PackageNotInstalledError: Package is not installed in prefix."

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.