如何指定包源?

时间:2017-10-10 10:58:04

标签: python pip setuptools pypi

我的包依赖于PyMySQL 问题:
然后我上传包到test.pypi.org并尝试安装它.logo2 { background-image: url('https://i.ytimg.com/vi/SfBR9aGrk9k/maxresdefault.jpg'); no-repeat: true; display: block; position: relative; width: 316px; height: 300px; padding-bottom: 20%; background-size: 100%; background-repeat: no-repeat } 我的代码中有一个异常,因为test.pypi.org上的PyMySQL版本是0.6.3-rc1而不是当前的0.7.11 我的pip install -U -i https://testpypi.python.org/pypi scrapy-mysql-pipeline

setup.py

我的import setuptools import os if "PY_DEV" in os.environ: import pypandoc with open('README.rst', 'w') as f: f.write(pypandoc.convert('README.md', 'rst')) else: os.environ.update(SKIP_WRITE_GIT_CHANGELOG='1') os.environ.update(SKIP_GENERATE_AUTHORS='1') setuptools.setup( setup_requires=['pbr', ], pbr=True )

setup.cfg

[metadata] name = scrapy-mysql-pipeline author = Iaroslav Russkykh author-email = iarruss@ya.ru summary = Asynchronous mysql Scrapy item pipeline license = MIT description-file = README.rst home-page = https://github.com/IaroslavR/scrapy-mysql-pipeline requires-python = >=2.7 classifier = Development Status :: 4 - Beta Framework :: Scrapy Intended Audience :: Developers License :: OSI Approved :: Apache Software License Operating System :: OS Independent Programming Language :: Python Topic :: Internet :: WWW/HTTP [files] packages = scrapy_mysql_pipeline [wheel] universal = 1 导致点数错误:requirements.txt

No matching distribution found for pymysql>=0.7.11 (from scrapy-mysql-pipeline)

如何指定使用pypi.org中的包?

1 个答案:

答案 0 :(得分:1)

尝试--extra-index-url

pip install -U --index-url=https://testpypi.python.org/pypi --extra-index-url=https://pypi.python.org/pypi scrapy-mysql-pipeline