7

我已经在 Spyder 和 Python 3.6 附带的 Windows 10 机器上安装了 Anaconda,但我希望升级到 Python 3.7

使用 Python 3.7 创建 Anaconda 环境很容易,使用:

conda create --name py37 python=3.7

或者:

conda create --name py370 python=3.7.0 --channel conda-forge

然而,在这种环境中启动 Spyder 会将其退回到 Python 3.6。我尝试直接在 Spyder 中指定 python.exe(对于 3.7 版)Tools -> Settings,但是在重新启动后,Spyder 内核无法启动,并且会显示它们需要软件包:ipykernelcloudpickle.

在环境中尝试使用conda install它们时,会出现以下内容:

The following packages will be DOWNGRADED:

    python:           3.7.0-hea74fb7_0      --> 3.6.6-hea74fb7_0

这将再次将 python 从 3.7 降级到 3.6。

我最后的尝试是使用命令:

conda install python==3.7

输出失败

Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - python-dateutil -> python[version='>=2.7,<2.8.0a0']
  - python-dateutil -> six
  - python==3.7
Use "conda info <package>" to see the dependencies for each package.

问题不是如何将 Conda 升级到 Python 3.7,而是如何让 Spyder 在自己的环境中使用 Python 3.7

4

1 回答 1

16

当您spyder从 CMD/终端运行时,您的操作系统会尝试在系统的 PATH 上查找 spyder 可执行文件。在这种情况下,它将默认返回到运行 Python 3.6 的基本环境的 spyder 版本。

到目前为止我发现的最好的方法是将 spyder 安装到新环境中;激活环境,然后运行 ​​spyder (它应该在本地环境中启动版本)。

conda create --name py37 python=3.7  
conda install --name py37 spyder -c conda-forge
conda activate py37
spyder

不过这需要spyder的版本支持python 3.7。目前不可用(截至 2018 年 7 月 2 日),但应该不会太久。

编辑: Python 3.7 的 Spyder 可用。

于 2018-07-02T15:21:07.247 回答