简体   繁体   English

如何使用 Spyder 和 Python 2.7 安装 conda 环境?

[英]How to install a conda environment with Spyder and Python 2.7?

SOmething as simple as:像这样简单的东西:

conda create -n py2 python=2.7

and then in that environment然后在那个环境中

conda install spyder=3

fails to solve for the environment.无法解决环境问题。 Although the only things here are python=2.7 basics and spyder=3, which on their own website specifies requires python 2.7 https://www.psych.mcgill.ca/labs/mogillab/anaconda2/lib/python2.7/site-packages/spyder/doc/installation.html#requirements虽然这里唯一的东西是 python=2.7 基础和 spyder=3,在他们自己的网站上指定需要 python 2.7 https://www.psych.mcgill.ca/labs/mogillab/anaconda2/lib/python2.7/site-包/spyder/doc/installation.html#requirements

Why does this fail, and how can one get something that basic to work?为什么这会失败,如何才能得到一些基本的工作?

New attempts: (Last one are specific versions that I know work together, as I have them on my main system wide install).新尝试:(最后一个是我知道可以协同工作的特定版本,因为我在我的主要系统范围内安装了它们)。

conda create -n py2 python=2.7 spyder                    --> Fails to solve env

conda create -n py2 python=2.7 spyder -c free            --> installs spyder4

conda create -n py2 python=2.7 spyder=3 -c free          --> AttributeError on launch

conda create -n py2 python=2.7.17 spyder=3.2.3 -c free   --> AttributeError on launch

All fail.都失败了。 If I don't specify spyder=3, conda installs spyder=4, which is a no-go as those versions of python and spyder do not work together (why doesn;t conda know this when checking for compatibility?).如果我不指定 spyder=3,conda 安装 spyder=4,这是不行的,因为 python 和 spyder 的那些版本不能一起工作(为什么不;康达在检查兼容性时不知道这一点?)。 When specifying spyder=3, environment fails to solve except when using channel free , as kindly suggested in the comments.当指定 spyder=3 时,环境无法解决,除非使用channel free ,正如评论中所建议的那样。 But this method also fails when launching Spyder, throwing AttributeErrors.但是这个方法在启动 Spyder 时也会失败,抛出 AttributeErrors。

I hit some Qt issues when launching, that seem to resolve with fixing qtawesome to an older version.我在启动时遇到了一些 Qt 问题,似乎可以通过将qtawesome到旧版本来解决。 Here's the final spec that works for me ( osx-64 ):这是适用于我的最终规范( osx-64 ):

conda create -n py2 --override-channels -c conda-forge python=2.7 spyder=3.3 qtawesome=0.7

or as a YAML或作为 YAML

py2.yaml py2.yaml

name: py2
channels:
  - conda-forge
dependencies:
  - python=2.7
  - spyder=3.3
  - qtawesome=0.7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM