0

I'm using Windows 8, Anaconda 4.4.0, Python 3.6

I've followed this tutorial to create an enviroment named snakes with Python version 3.5 which is what I want, but after I typed activate snakes in Anaconda Prompt and restarting Spyder, sys.version_info and sys.path doesn't change, I'm still in Python 3.6.

I've also seen this post here and followed the answer, still can't solve the problem

LtChang
  • 135
  • 12
  • Kindly install Python 2.7 in your machine. Open the environment variable window and set the python 2.7 path to be the 1st one. Save and open the command prompt, type python -version to get 2.7 version. – jose praveen Aug 17 '17 at 06:14

1 Answers1

0

The activate command only changes the path variable. You need to point Spyder to the new Python executable. There are instructions here to do so.

Specifically, you need to got to "Preferences > Python interpreter > Use the following interpreter" and provide the path to the new Python executable that was created when you made the new env. On my system, thats under "Anaconda3/envs/[name of env]/bin"

bendl
  • 1,583
  • 1
  • 18
  • 41
  • I still need to use activate first? I've noticed that every time I restart the prompt I'm back to the old env(root) again. – LtChang Aug 16 '17 at 17:02
  • No you shouldn't need to use activate at all for the IDE. I'm not certain of `activate`'s behavior between sessions. My guess is that it changes the path variable only for one session. Meaning that you will have to `activate` each time – bendl Aug 16 '17 at 17:04
  • I've done what you suggested, sys.version is 3.5.4 now but sys.path still points to the old path and I failed to import numpy, do you know what happened? another question is now I can't IPython console, it says that 'Your Python environment or installation doesn't have the ipykernel module installed on it' – LtChang Aug 16 '17 at 17:15
  • Environments do not share libraries (as far as I know). Verify that numpy and IPython console were both installed with the new environment. – bendl Aug 16 '17 at 17:17
  • I mean, while I've changed the executable but the sys.path is still the same, so I'm wondering if I miss somethong here? should I install Spyder for new environment? – LtChang Aug 17 '17 at 00:26
  • @LtChang has the issue been solved. If not, please read this [post](https://thinkingvirtually.blogspot.in/2017/08/anaconda-environment-setup-import-tensorflow-solved.html) for installing new environment using conda prompt option. – jose praveen Aug 19 '17 at 06:35