我一直在尝试安装配置了以下设置的软件包:
setup(
packages=find_packages(),
include_package_data=True,
install_requires=[
'Django==1.5.1',
'xhtml2pdf',
],
dependency_links=[
'https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf',
],
)
但是,它从 PyPi 安装 XHTML2PDF 包,而不是使用指定的链接。根据输出(我使用 运行安装pip install -vvv package.tar.gz
),它可能无法从链接解析版本(// 1
在代码中),或者我没有指定正确的项目名称(// 2
在代码中):
Downloading/unpacking xhtml2pdf (from mypackage==1.3)
Getting page https://pypi.python.org/simple/xhtml2pdf/
URLs to search for versions for xhtml2pdf (from mypackage==1.3):
* https://pypi.python.org/simple/xhtml2pdf/
* https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf
Getting page https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947
Analyzing links from page https://pypi.python.org/simple/xhtml2pdf/
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.1.tar.gz#md5=9f83a2bcb67858aca9e058761f3bea7b (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.1
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.2.tar.gz#md5=d640ccb9470942fd2e6d3ae740c27dc1 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.2
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.1.zip#md5=4ad41c845735ae14da99085311d84c00 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.1
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.4.zip#md5=5f035cd6532bef99b7d35054caaa6ef7 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.4
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.3.zip#md5=32599c74f26f57ebd002765741ec64f7 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.3
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.2.zip#md5=4047a8234eb6b77591d526dcb1f60161 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.2
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.3.tar.gz#md5=13b0d6059b72c994473fddfa7a528451 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.3
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.5.zip#md5=8db99aae8536436a2b7b0b3987197b99 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.5
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.5.tar.gz#md5=1ef268b40c11bf966f7c6c5504299e3e (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.5
Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.4.tar.gz#md5=36b015a4e2918460711cbc5eebe026ce (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.4
Analyzing links from page https://codeload.github.com/chrisglass/xhtml2pdf/legacy.zip/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947
Could not parse version from link: https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf // 1
Skipping link https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf; wrong project name (not xhtml2pdf) // 2
Using version 0.0.5 (newest of versions: 0.0.5, 0.0.5, 0.0.4, 0.0.4, 0.0.3, 0.0.3, 0.0.2, 0.0.2, 0.0.1, 0.0.1)
Downloading xhtml2pdf-0.0.5.zip (118kB):
Downloading from URL https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.5.zip#md5=8db99aae8536436a2b7b0b3987197b99 (from https://pypi.python.org/simple/xhtml2pdf/)
...Downloading xhtml2pdf-0.0.5.zip (118kB): 118kB downloaded
如果我将版本号添加到xhtml2pdf-0.0.5
两者中的包 ( ) 中install_requires
,dependency_links
它会找到 Git 链接并且不会抱怨它们,但仍会从 PyPi 安装。
我一直在寻找答案一段时间,但一直无法找到解决方案。我需要 Git 版本,因为它修复了 PyPi 版本还没有的问题。