从Mac到PC-不同的Anaconda环境 [英] From Mac to PC - Different Anaconda environments

查看:175
本文介绍了从Mac到PC-不同的Anaconda环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mac/Linux的长期用户,最近购买了Windows笔记本电脑.我在Mac上使用PyEnv安装了两个完全独立的Anaconda安装程序,这使我可以有效地隔离它们.当然,这会浪费Mac硬盘上的一些空间,但是我不介意.

I am a long time Mac/Linux user who has recently purchased a Windows laptop. I have two completely separate Anaconda installations on my Mac using PyEnv which allows me to isolate them effectively. Sure it wastes a bit of space on my Mac's hard disk, but I do not mind.

很长一段时间后我将返回Windows机器,因此我还没有完全掌握最新的技术.有没有办法在Windows上有效隔离两个不同版本的Anaconda?一个用于python 3,另一个用于python 2?我经常在python 3和2上使用不同的库和软件包,例如pandas等,并且还使用'conda install'或'pip'安装其他软件包.在Windows计算机上为Python 3和2管理两个Anaconda环境的最佳策略是什么?再说一次,磁盘容量不是问题,因为我的Windows计算机上有一个1 TB的驱动器.

I am returning to a Windows machine after a long time, so I am not quite up to speed yet. Is there a way to effectively isolate two different versions of Anaconda on Windows? One for python 3 and other for python 2? I am frequently using different libraries and packages, e.g., pandas, etc. on both python 3 and 2 and also installing other packages either using 'conda install' or 'pip'. What is the optimal strategy for managing two Anaconda environments for Python 3 and 2 on the Windows machine? Once again, the disk capacity is not a problem since I have a one terabyte drive on my Windows machine.

推荐答案

您可以集中安装Anaconda并使用本机环境功能.假设您在计算机上安装了3.6版本的Anaconda,则可以使用2.7版本的Anaconda创建环境,如下所示:

You can have one central installation of Anaconda and use the native environment feature. 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:

conda create --name py27 python=2.7 anaconda

并且您可以conda将所需的任何软件包安装到您的环境中.

And you can conda install whatever packages you desire into your environment.

这篇关于从Mac到PC-不同的Anaconda环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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