在python 2和3的spyder之间切换 [英] Switch between spyder for python 2 and 3

查看:527
本文介绍了在python 2和3的spyder之间切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我在文档中了解到的那样,它表明您只需在命令提示符下创建一个新变量即可轻松地在2个python环境之间切换

From what I have learnt in the documentation it states that you can easily switch between 2 python environments by just creating a new variable using command prompt

如果我已经安装了python 2.7,则"conda create -n python34 python = 3.4 anaconda".

"conda create -n python34 python=3.4 anaconda" if i already have python 2.7 installed.

创建了一个名为python 34的环境,我们可以使用"activate python 34"将其激活,但是所有这些操作都像在Windows命令提示符下执行上述命令一样发生.我想在spyder IDE中的python版本之间切换,该怎么做?

An environment named python 34 is created and we can activate it using "activate python 34" But all this happens like executing the above commands happens in my windows command prompt. I want to switch between python versions in spyder IDE, How to do this?

推荐答案

Spyder是从您所使用的环境启动的.

Spyder is launched from the environment that you're using.

因此,如果您想在Spyder中使用python 3,请activate python34(或使用Python 3命名的任何环境)然后运行spyder.

So if you want to use python 3 in Spyder then you activate python34 (or whatever you named the environment with Python 3) then run spyder.

如果要在Spyder中使用python 2,请deactivate python3环境(或activate安装了Python 2的环境),然后运行spyder.

If you want to use python 2 in Spyder then you deactivate the python3 environment (or activate an environment in which you installed Python 2) then run spyder.

我不相信Spyder启动后就可以更改环境.

I do not believe that you can change environments once Spyder is launched.

您可能需要根据自己的设置在每个环境中安装Spyder,方法是先激活环境,然后使用conda install spyder.

N.B. you may need to install Spyder in each environment, depending on your set up, by first activating the environment then using conda install spyder.

这篇关于在python 2和3的spyder之间切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆