使用conda创建虚拟环境,尽管指定了版本,但我得到的Python版本错误。为什么? [英] Using conda to create virtual environment, I get the wrong version of Python despite specifying version. Why?

查看:2242
本文介绍了使用conda创建虚拟环境,尽管指定了版本,但我得到的Python版本错误。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个带有Python 3.5的虚拟环境,因此我可以运行一些tensorflow项目(tensorflow在我通常使用的Python 3.6上不起作用)。我使用conda的原因是(如您所见),我对unix /理解我的计算机很不好。

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.

我输入

conda create -n myenv python=3.5

然后

activate myenv

,然后检查Python版本,

and then, to check, Python version,

python -V

回复是 Python 3.6 ,这不是我想要的。

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

查看这个问题,似乎我需要在虚拟环境之外安装Python 3.5才能进行调用,但是如何做到这一点而又不弄乱我安装的Python 3.6?

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.

推荐答案

我终于通过查看此问题。如果我输入

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

cd ..

进入文件夹说明的第一步,然后检查我的Python版本,我拥有正确的版本(Python 3.5)。从那里我可以安装tensorflow并将其毫无问题地导入到python中。我不知道为什么,但是它有效,所以我不会抱怨。

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.

这篇关于使用conda创建虚拟环境,尽管指定了版本,但我得到的Python版本错误。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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