install-requires

setup.py: require a recent version of setuptools before trying to install

爱⌒轻易说出口 提交于 2019-12-21 05:31:20
问题 I'm creating a package that has 'typing;python_version<"3.5"' in it's install_requires . Apparently, this kind of dependency specification has only been implemented in recent versions of setuptools . If the setuptools on the user's machine is old they'll get: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in typing;python_version<"3.5" at ;python_version<"3.5" The easy solution is to tell the users to pip

install_requires based on python version

为君一笑 提交于 2019-12-18 10:33:10
问题 I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2. Something like: install_requires=[ "threadpool >= 1.2.7 if python_version < 3.2.0", ], How can one make that? 回答1: setuptools has support for this using environment markers. install_requires=[ 'enum34;python_version<"3.4"', 'pywin32 >= 1.0;platform_system=="Windows"' ] Use of this is detailed in the official documentation. Based on the change log

Installing matplotlib through setuptools install_requires

六眼飞鱼酱① 提交于 2019-12-12 06:17:32
问题 I have been trying to install matplotlib through install_requires and it has been failing with error: unexpected html page found... When I just try to install it regularly through pip it seems to work fine. Does anyone know how to fix this kind of issue with install_requires. I would like setup.py to handle these issues. I had a similar problem with numpy failing with Python.h problems, but then a regular pip install fixed that as well. 来源: https://stackoverflow.com/questions/28566843

install_requires based on python version

荒凉一梦 提交于 2019-11-29 22:53:13
I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2. Something like: install_requires=[ "threadpool >= 1.2.7 if python_version < 3.2.0", ], How can one make that? setuptools has support for this using environment markers . install_requires=[ 'enum34;python_version<"3.4"', 'pywin32 >= 1.0;platform_system=="Windows"' ] Use of this is detailed in the official documentation . Based on the change log was added in v20.5, but the implementation wasn't stable until v20.8.1 (which was only a gap of 15 days).

python setuptools install_requires is ignored when overriding cmdclass

廉价感情. 提交于 2019-11-27 20:08:35
I have a setup.py that looks like this: from setuptools import setup from subprocess import call from setuptools.command.install import install class MyInstall(install): def run(self): call(["pip install -r requirements.txt --no-clean"], shell=True) install.run(self) setup( author='Attila Zseder', version='0.1', name='entity_extractor', packages=['...'], install_requires=['DAWG', 'mrjob', 'cchardet'], package_dir={'': 'modules'}, scripts=['...'], cmdclass={'install': MyInstall}, ) I need MyInstall because I want to install some libraries from github and I didn't want to use dependency_links

python setuptools install_requires is ignored when overriding cmdclass

旧城冷巷雨未停 提交于 2019-11-26 20:11:41
问题 I have a setup.py that looks like this: from setuptools import setup from subprocess import call from setuptools.command.install import install class MyInstall(install): def run(self): call(["pip install -r requirements.txt --no-clean"], shell=True) install.run(self) setup( author='Attila Zseder', version='0.1', name='entity_extractor', packages=['...'], install_requires=['DAWG', 'mrjob', 'cchardet'], package_dir={'': 'modules'}, scripts=['...'], cmdclass={'install': MyInstall}, ) I need