简体   繁体   English

从Mac到PC-不同的Anaconda环境

[英]From Mac to PC - Different Anaconda environments

I am a long time Mac/Linux user who has recently purchased a Windows laptop. 我是Mac / Linux的长期用户,最近购买了Windows笔记本电脑。 I have two completely separate Anaconda installations on my Mac using PyEnv which allows me to isolate them effectively. 我使用PyEnv在Mac上安装了两个完全独立的Anaconda安装,这使我可以有效地隔离它们。 Sure it wastes a bit of space on my Mac's hard disk, but I do not mind. 当然,这会浪费Mac硬盘上的一些空间,但是我不介意。

I am returning to a Windows machine after a long time, so I am not quite up to speed yet. 很长一段时间后,我将返回Windows机器,所以我还没有完全掌握速度。 Is there a way to effectively isolate two different versions of Anaconda on Windows? 有没有办法在Windows上有效隔离两个不同版本的Anaconda? One for python 3 and other for python 2? 一个用于python 3,另一个用于python 2? I am frequently using different libraries and packages, eg, pandas, etc. on both python 3 and 2 and also installing other packages either using 'conda install' or 'pip'. 我经常在python 3和2上使用不同的库和包,例如pandas等,并且还使用“ conda install”或“ pip”安装其他包。 What is the optimal strategy for managing two Anaconda environments for Python 3 and 2 on the Windows machine? 在Windows计算机上为Python 3和2管理两个Anaconda环境的最佳策略是什么? Once again, the disk capacity is not a problem since I have a one terabyte drive on my Windows machine. 再一次,磁盘容量不是问题,因为我的Windows计算机上有一个1 TB的驱动器。

You can have one central installation of Anaconda and use the native environment feature. 您可以在中央安装Anaconda,并使用本机环境功能。 Let's say you install the 3.6 version of Anaconda onto your machine, you can create an environment with the full 2.7 version of Anaconda like this: 假设您在计算机上安装了3.6版本的Anaconda,则可以使用2.7版本的Anaconda创建环境,如下所示:

conda create --name py27 python=2.7 anaconda

And you can conda install whatever packages you desire into your environment. 您也可以将所需的任何软件包安装到环境中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM