Spyder 无法在 Windows 10 上的 Anaconda 虚拟环境中运行 [英] Spyder does not run in Anaconda virtual environment on Windows 10
问题描述
这是我在这里的第一篇文章.我试图找到这个问题的答案,但无济于事.
This is my first post here. I tried to find an answer to this question but to no avail.
刚刚在我的 Win10 机器上安装了 Anaconda2(2.7.11 Python 内核).我正在尝试学习 conda 命令.这是我的问题.
Just installed Anaconda2 (2.7.11 Python kernel) on my Win10 machine. I am trying to learn the conda command. Here is my problem.
- 我转到 Anaconda 提示窗口.
- 我使用
conda create -n myenv python=3.4
命令创建了一个虚拟环境. - 我使用
activate myenv
激活环境. - 当我使用
conda env list
列出环境时,它显示为活动状态(旁边有星号). - 当我从命令行启动 python 时,它显示它正在运行 3.4.
- 与 ipython 相同.
- 当我输入 spyder 时,它会打开 spyder 窗口,但会显示 2.7.11.这通过运行
print(sys.version)
得到确认.
- I go to the Anaconda prompt window.
- I create a virtual environmant with
conda create -n myenv python=3.4
command. - I activate the environment with
activate myenv
. - When I list the environmants with
conda env list
it shows as active (star next to it). - When I start python from a command line it shows me that it is running 3.4.
- The same with ipython.
- When I type spyder it opens the spyder window but shows me 2.7.11. This is confirmed by running
print(sys.version)
.
我做错了什么还是这只是 Windows 10 的问题.
Am I doing anything wrong or is this just windows 10 problem.
提前致谢,安迪
推荐答案
当您键入 spyder
时,会在 conda 环境创建的路径中开始搜索此命令.如果它在那里找不到它,它会去其他地方搜索.在您的情况下,在默认 Anaconda 安装的路径中.所以在你激活你的环境之后:
When you type spyder
, the search for this command begins in the paths that the conda environment created. If it cannot find it there, it will go and search at other places. In your case in the paths of the default Anaconda install. So after you activate your environment:
activate myenv
你需要安装sypder
inside这个环境:
you need to install sypder
inside this environment:
(myenv) conda install spyder
其中 (myenv)
表示活动环境.
where (myenv)
indicates the active environment.
这篇关于Spyder 无法在 Windows 10 上的 Anaconda 虚拟环境中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!