anaconda python 3.6 中的 configparser
configparser in python 3.6 in anaconda
我正在尝试将一些代码从 2.7 移植到 3.6,但在 anaconda 中为 py-3.6 安装包 configparser 时遇到问题。
当我执行以下命令时,出现错误:
$ conda install -c anaconda configparser
UnsatisfiableError: The following specifications were found to be in conflict:
- configparser -> python[version='>=2.7,<2.8.0a0']
- python=3.6
依赖项也给了我相同的信息:
conda info configparser
configparser 3.5.0 py27h5117587_0
---------------------------------
dependencies:
python >=2.7,<2.8.0a0
但是,问题-14087598 说该包在 py-3.6 中可用。我应该如何在 anaconda 中安装这个包?
(上面link中的一个解决方案建议通过python程序本身安装,但我想通过anaconda安装。)
包 configparser
is a backport of a Python 3.5 standard module to older versions of Python. Unfortunately, it appears that the Anaconda version of this package 没有为 Python 3 打包。
但是,您使用的是 Python 3.6,因此您可以简单地使用 configparser
which comes preinstalled with Python 而不是安装任何东西。
您尝试移植的源代码可能包含这样一行(如果未安装反向移植将失败):
from backports import configparser
您可以可能将该行替换为以下内容:
import configparser
backport 中安装的 3.5 兼容版本与 3.6 提供的版本之间存在细微差别,但 3.6 版本对于大多数合理的用例应该是向后兼容的。 from backports
形式的主要目的是允许在仅 3.x 的环境中开发与 2.x 兼容的代码,而不会意外使用向后移植中不存在的新功能。
我正在尝试将一些代码从 2.7 移植到 3.6,但在 anaconda 中为 py-3.6 安装包 configparser 时遇到问题。
当我执行以下命令时,出现错误:
$ conda install -c anaconda configparser
UnsatisfiableError: The following specifications were found to be in conflict:
- configparser -> python[version='>=2.7,<2.8.0a0']
- python=3.6
依赖项也给了我相同的信息:
conda info configparser
configparser 3.5.0 py27h5117587_0
---------------------------------
dependencies:
python >=2.7,<2.8.0a0
但是,问题-14087598 说该包在 py-3.6 中可用。我应该如何在 anaconda 中安装这个包?
(上面link中的一个解决方案建议通过python程序本身安装,但我想通过anaconda安装。)
包 configparser
is a backport of a Python 3.5 standard module to older versions of Python. Unfortunately, it appears that the Anaconda version of this package 没有为 Python 3 打包。
但是,您使用的是 Python 3.6,因此您可以简单地使用 configparser
which comes preinstalled with Python 而不是安装任何东西。
您尝试移植的源代码可能包含这样一行(如果未安装反向移植将失败):
from backports import configparser
您可以可能将该行替换为以下内容:
import configparser
backport 中安装的 3.5 兼容版本与 3.6 提供的版本之间存在细微差别,但 3.6 版本对于大多数合理的用例应该是向后兼容的。 from backports
形式的主要目的是允许在仅 3.x 的环境中开发与 2.x 兼容的代码,而不会意外使用向后移植中不存在的新功能。