问题:同时安装Anacondas 2.7和3.5可以吗?

我目前正在将Anaconda与Python 2.7一起使用,但是我将需要使用Python 3.5。可以同时安装它们吗?我应该期待一些问题吗?
我使用的是64位Win8。

I am using currently Anaconda with Python 2.7, but I will need to use Python 3.5. Is it ok to have them installed both in the same time? Should I expect some problems?
I am on a 64-bit Win8.


回答 0

我的理解是,您无需再次安装Anaconda即可开始使用其他版本的python。相反,conda 可以单独管理python 2和3环境

My understanding is you don’t need to install Anaconda again to start using a different version of python. Instead, conda has the ability to separately manage python 2 and 3 environments.


回答 1

我会同时使用这两种方法,具体取决于我所帮助的部门(有些人喜欢2.7,有些人则喜欢3.5)。无论如何,我使用Anaconda,默认安装为3.5。我将环境用于其他版本的python,软件包等。因此,例如,当我想开始使用python 2.7时,我运行了:

 conda create -n Python27 python=2.7

这将创建一个名为Python27的新环境并安装Python版本2.7。您可以在该行中添加参数以默认情况下安装其他软件包,也可以只是从头开始。该环境将自动激活,只需在命令行中键入deactivate(windows)或source deactivate(linux,osx)即可停用。要在以后激活,请键入activate Python27(windows)或source activate Python27(linux,osx)。如果您选择采用那条路线,我建议您阅读Anaconda中的管理环境文档。

更新资料

conda4.6版开始,您现在可以使用conda activateconda deactivate。采用source现在已被弃用,最终将被删除。

I use both depending on who in my department I am helping (Some people prefer 2.7, others 3.5). Anyway, I use Anaconda and my default installation is 3.5. I use environments for other versions of python, packages, etc.. So for example, when I wanted to start using python 2.7 I ran:

 conda create -n Python27 python=2.7

This creates a new environment named Python27 and installs Python version 2.7. You can add arguments to that line for installing other packages by default or just start from scratch. The environment will automatically activate, to deactivate simply type deactivate (windows) or source deactivate (linux, osx) in the command line. To activate in the future type activate Python27 (windows) or source activate Python27 (linux, osx). I would recommend reading the documentation for Managing Environments in Anaconda, if you choose to take that route.

Update

As of conda version 4.6 you can now use conda activate and conda deactivate. The use of source is now deprecated and will eventually be removed.


回答 2

是的你可以。

您不必都下载两个Anaconda。

只有您需要下载Anaconda版本之一,并且需要激活其他版本的Anaconda python。

如果您拥有Python 3,则可以这样设置Python 2内核;

python2 -m pip install ipykernel

python2 -m ipykernel install --user

如果您有Python 2,

python3 -m pip install ipykernel

python3 -m ipykernel install --user

然后,您将能够看到两个版本的Python!

如果您正在使用Anaconda Spyder,则应在此处交换版本:

在此处输入图片说明

如果您使用的是木星,请在这里检查:

在此处输入图片说明

注意:如果安装后Jupiter或Anaconda已打开,则需要重新启动。然后您将能够看到。

Yes you can.

You don’t have to download both Anaconda.

Only you need to download one of the version of Anaconda and need activate other version of Anaconda python.

If you have Python 3, you can set up a Python 2 kernel like this;

python2 -m pip install ipykernel

python2 -m ipykernel install --user

If you have Python 2,

python3 -m pip install ipykernel

python3 -m ipykernel install --user

Then you will be able to see both version of Python!

If you are using Anaconda Spyder then you should swap version here:

enter image description here

If you are using Jupiter then check here:

enter image description here

Note: If your Jupiter or Anaconda already open after installation you need to restart again. Then you will be able to see.


回答 3

我已经安装了python 2.7.13和3.6.2。首先为python 3安装Anaconda,然后可以使用conda语法获得2.7。我的安装使用了:conda create -n py27 python = 2.7.13 anaconda

I have python 2.7.13 and 3.6.2 both installed. Install Anaconda for python 3 first and then you can use conda syntax to get 2.7. My install used: conda create -n py27 python=2.7.13 anaconda


回答 4

是的,可以同时安装两个版本。如今,实际上已经很期待了。2.7中编写了很多东西,但是3.5正在成为规范。我建议您尽快将所有python更新到3.5。

Yes, It should be alright to have both versions installed. It’s actually pretty much expected nowadays. A lot of stuff is written in 2.7, but 3.5 is becoming the norm. I would recommend updating all your python to 3.5 ASAP, though.


回答 5

Anaconda是根据您的要求制造的。它也是环境经理。它分离出环境。之所以这样做,是因为较新/不稳定的宿主语言版本不支持稳定和旧版软件包。因此,需要一种可以在同一台计算机上分离和管理这些版本的软件,而无需重新安装或卸载单个主机编程语言/环境。

您可以在Anaconda文档中找到环境的创建/删除。

希望这会有所帮助。

Anaconda is made for the purpose you are asking. It is also an environment manager. It separates out environments. It was made because stable and legacy packages were not supported with newer/unstable versions of host languages; therefore a software was required that could separate and manage these versions on the same machine without the need to reinstall or uninstall individual host programming languages/environments.

You can find creation/deletion of environments in the Anaconda documentation.

Hope this helped.


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。