Switch between Python 3.x and 3.y through anaconda?

让人想犯罪 __ 提交于 2020-01-16 12:35:06

问题


I have a HDP cluster and I'm working with couple data scientist, we're working on Python 3.5 (anaconda3) and I would switch to the new Python version 3.6 while keeping the previous version which is 3.5

My questions:

Is that possible having 2 version of Python like 3.5 and 3.6 through anaconda?

if that true, how can I switch between those two version?


回答1:


You have to create two environments:

conda create -n py35 python=3.5
conda create -n py36 python=3.6

then you can change to the desired environment using

source activate py35

or source activate py36

you can then pip instal and use python specific to that environment

To leave an environment use

source deactivate

read up on it in the anaconda documentation

Note: on windows, use an anaconda prompt and leave out the source



来源:https://stackoverflow.com/questions/49529465/switch-between-python-3-x-and-3-y-through-anaconda

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