Using conda to create virtual environment, I get the wrong version of Python despite specifying version. Why?

大城市里の小女人 提交于 2019-12-13 18:09:21

问题


I need a virtual environment with Python 3.5, so I can run some tensorflow projects (tensorflow doesn't work on Python 3.6, which I normally use). I use conda because (as you'll see) I'm so bad at unix/understanding my computer.

I type in

conda create -n myenv python=3.5

and then

activate myenv

and then, to check, Python version,

python -V

The reply is Python 3.6 which is not the one I want.

Looking at this question, it seems like I need to install Python 3.5 outside of the virtual environment in order to call it, but how do I do that without messing with my installation of Python 3.6?

I get that this is a basic question but I'm terrible at computers and would be so grateful for any replies. Talk to me like I'm a child bc that's basically the level I'm on.


回答1:


I finally figured out what was wrong (sort of) by looking at this question. If i typed in

cd ..

to go one step up in the folder struction, and then checked my Python version, I had the right version (Python 3.5). From there I could install tensorflow and it was imported to python without problem. I have no idea why, but it works so I can't complain.



来源:https://stackoverflow.com/questions/50569190/using-conda-to-create-virtual-environment-i-get-the-wrong-version-of-python-des

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