在“setup.py”中指定 Python 2.7+ 和 Python 3.xx(任何)

Jee*_*eet 5 python version setup.py

我的“ setup.py”目前包括以下声明:

setup(...
    classifiers = [
            ...
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.1",
            "Programming Language :: Python :: 3.2",
            "Programming Language :: Python :: 3.3",
            "Programming Language :: Python :: 3.4",
            "Programming Language :: Python :: 3.5",
            "Programming Language :: Python :: 3.6",
            "Programming Language :: Python",
            ...
            ],
    ...
    )
Run Code Online (Sandbox Code Playgroud)

有没有办法让我指定“任何 Python 3,从 3.0 起”,而无需明确列举所有现有和未来的 Python?

我问这个的原因是因为,即使上面指定了一般的“编程语言 :: Python :: 3”,Anaconda 安装失败:

Fetching package metadata ......... 
Solving package specifications: .... 
UnsatisfiableError: The following specifications were found to be in conflict:  
- dendropy 
- python 3.5
* Use "conda info <package>" to see the dependencies for each package
Run Code Online (Sandbox Code Playgroud)

pip安装工程的罚款。

谢谢!

MSe*_*ert 3

分类器只是提示,安装包时不会conda install或实际上会查看它们。pip install这些提示适用于搜索包裹或查看包裹的人。如果一个包支持所有 python 3 版本,那么您是否明确列出它们或正如"Programming Language :: Python :: 3"我猜大多数访问者会知道其含义一样并不重要 - 这更多是作者个人喜好的问题(以及已选择的分类器的数量)。

conda但是,当您使用(即使它是纯 python)安装包时,它必须针对您正在使用的 python 和操作系统版本进行构建。ericmjl在您的情况下,您尝试从conda 通道安装。该频道包含 python 3.5 版本,但仅适用于 OSX,Linux 的二进制文件仅是 python 3.4。

您可以使用 pip将其从PyPIpip install dendropy安装到您的 conda 环境中:(确保您使用pipconda 环境中安装的)。