how to install Spyder for python 2 and python3

匿名 (未验证) 提交于 2019-12-03 01:47:02

问题:

I have python2.7 installed (as default Windows7 - 64bit) and have python3 installed in an environment (called Python3).

I would like to use Spyder as my IDE. I have installed Spyder3 in my Python3 environment, but when i open Spyder3 (from within my Python3 env. then it opens Spyder for python 2.7 and not python 3.5 as I would've hoped for.). I don't know why.

I have done TOOLS--Preferences--Python Interpreter -- Use the following python enterpreter: C:\Users\16082834\AppData\Local\Continuum\Anaconda2\envs\Python3\python.exe, but this didn't work either.

Many of us are running multiple python environments, I am sure some of you might have managed to use Spyder for these different environments.

Please tell me how. Your help would be much appreciated.

回答1:

One possible way it to activate Python3 and then pip install Spyder.



回答2:

So, when you create a new environment with: conda create --name python36 python=3.6 anaconda

This will create an env. called python36 and the package to be installed is anaconda (which basically contains everything you'll need for python).

Be sure that your new env. actually is running the ecorrect python version by doing the following:

activate python environmentwith: active python36

then type: python

this will indicate what python version is running in your env. It turns out, for some reason, my environment was running python2.7 and not 3.6

The cool thing is that anaconda distribution comes with spyder. Just be sure that you run Spyder from within your environment.

So to do this: activate python36 then type: spyder

It will automatically open spyder3 for python3.

My initial issue was therefore that even though i created a python3 environment, it was still running python2.7. But after removing the old python3 environment and creating a new python3 env. and installing the desired libraries/packages it now works perfect.

I have a 2.7 and 3.6 environment which can both be edited with spyder2 and spyder3 IDE



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!