- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
= 1.2.7 if py-6ren">
我有一个适用于 python 2 和 python 3 的模块。在 Python<3.2 中,我想安装一个特定的包作为依赖项。对于 Python>=3.2。
类似:
install_requires=[
"threadpool >= 1.2.7 if python_version < 3.2.0",
],
如何做到这一点?
最佳答案
使用 environment markers :
install_requires=[
'threadpool >= 1.2.7; python_version < "3.2.0"',
]
Setuptools 的具体用法在其documentation 中有详细说明。 .上面显示的语法需要 setuptools v36.2+ (change log) .
关于python - install_requires 基于 python 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21082091/
这个问题在这里已经有了答案: Pip install from pypi works, but from testpypi fails (cannot find requirements) (2 个
我有一个 Python 库 ( https://github.com/jcrozum/PyStableMotifs ),我想在 PyPI 上发布。它依赖于另一个我无法控制的库 ( https://gi
我正在使用 setuptools 创建一个快速 setup.py 脚本来为用户安装依赖项。该软件包只需要 numpy 和 matlibplot。所以代码看起来像这样: from setuptools
我使用 python bdist_rpm 创建了一个新的 RPM。通常 python setup.py install 会安装 python 依赖项,如 websocket-client 或任何其他包
要制作一个python包,在setup.py中,我有以下内容: setup( name='TowelStuff', version='0.1.0', author='J. Ra
我在这里的问题可能看起来很幼稚,但我从未在网络资源上找到任何关于它的线索。 问题是,关于 install_requires 函数或 setup() 文件的 setup.cfg 参数, 提及使用的每个包
我有多个共享内部库,许多存储库都依赖这些库。现在,这些库位于同一个 git 存储库中,并在需要时被子模块到每个应用程序中。在构建期间,我将 pip 安装库。我面临的问题是这些内部库也相互依赖,但由于它
这是我的代码的一部分:(setup.py) args = { 'name' : 'ModernGL.PyQt5', 'version' : Version, 'descript
我需要添加 rjsmin通过 install_require 添加到我的依赖项在 setup.py 中。 rjsmin提供了一种使用 --without-c-extensions 禁用 c 扩展的方法
在上传之前,我在包目录中使用 pip3 install -e . 测试我的 PyPI 包。 依赖于pillow(在代码中导入PIL) 当我使用已安装的枕头进行测试时,它起作用了。 但是,我卸载了 pi
我有一个适用于 python 2 和 python 3 的模块。在 Python=3.2。 类似: install_requires=[ "threadpool >= 1.2.7 if py
我无法使用 setup.py 安装本地软件包 这是项目结构: my-project/ lib/ local1/ local1.1.0.whl index.
我需要使用 pip install SomePackage.tar.gz 安装一个 python 包。在此包的 setup.py 中,install_requires 下列出的一些库已成为 Pytho
我写了一个依赖openpyxl的python模块。我希望使用 setuptools 将 openpxyl 作为依赖项自动安装。我读到正确的方法是在 setup.py 脚本中包含以下内容: setup(
我想制作一个依赖于特定版本范围的包,例如>= 0.5.0, , =, == or !=, followed by a version identifier. 文档给出了一个这样的简单示例: docut
我有一个如下所示的 setup.py: from setuptools import setup from subprocess import call from setuptools.command
是否可以让 setuptools 的 extras_require 覆盖 install_requires 中的要求集?我的猜测是不,因为 extras_require 是一个 ...dictiona
我注意到一些 python 项目在所需模块列表中包含 setuptools。没有它,我的代码可以正常安装和执行。 我可能错了,但我认为 install_requires 列表的目的是指定安装后执行所需
我已经使用 pip 安装 PIL。安装时需要两个额外的参数。所以安装命令看起来像这样。 pip install PIL --allow-external PIL --allow-unverified
我正在创建一个 setup.py依赖于私有(private) GitHub 存储库的项目的文件。文件的相关部分如下所示: from setuptools import setup setup(name
我是一名优秀的程序员,十分优秀!