我正在尝试将ScientificPython列为我setup.py
中的依赖项。但是,在安装过程中,python似乎找不到包。我的做法有什么问题?
这是我的设置:
import setuptools
setuptools.setup(name = 'MyPack', version = '0.1',
description= 'Description.',
author = 'Me',
packages = setuptools.find_packages(),
install_requires = ['ScientificPython'],
dependency_links = ["https://sourcesup.cru.fr/frs/?group_id=180&release_id=1351#stable-releases-2-8-title-content"])
当我运行python setup.py install
时,这是输出的重要部分:
Processing dependencies for MyPack==0.1
Searching for ScientificPython
Reading https://sourcesup.cru.fr/frs/?group_id=180&release_id=1351#stable-releases-2-8-title-content
Download error: unknown url type: https -- Some packages may not be found!
Reading http://pypi.python.org/simple/ScientificPython/
Reading http://dirac.cnrs-orleans.fr/ScientificPython/
Reading http://starship.python.net/~hinsen/ScientificPython/
No local packages or download links found for ScientificPython
Best match: None
Traceback (most recent call last):
File "setup.py", line 22, in <module>
dependency_links = ["https://sourcesup.cru.fr/frs/?group_id=180&release_id=1351#stable-releases-2-8-title-content"])
File "/home/woltan/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/home/woltan/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/woltan/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 76, in run
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 104, in do_egg_install
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 211, in run
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 427, in easy_install
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 478, in install_item
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 519, in process_distribution
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 563, in resolve
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 799, in best_match
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 811, in obtain
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 434, in easy_install
File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
也许有一个问题是,虽然PyPI无法访问ScientificPython,或者easy_install ScentificPython
至少无法下载,但No local packages or download links found for ScentificPython
会失败。
为了使用setuptools安装ScientificPython,我需要做什么?
答案 0 :(得分:3)
您是否尝试将直接下载链接(https://sourcesup.cru.fr/frs/download.php/2309/ScientificPython-2.8.tar.gz
)放入dependency_links
而不是html页面,因为您的脚本似乎找不到该包,然后尝试安装None
。
编辑:刚注意到:python显然无法打开https资源 - 尝试在没有https的情况下上传它,使用普通的http
编辑2:你为什么不把整个ScientificPython文件夹放到你的发行文件夹中,并确保你的setup.py调用它的setup.py(或你需要调用的任何其他内容)?
答案 1 :(得分:2)
问题在于它试图与https站点建立http连接。据我所知,setuptools不支持与https的连接。您将不得不使用另一种方法来获取这些包。
我的建议,如果你想使用setuptools,那么你在README中详细说明了他们必须下载该依赖项并安装它的文件,然后在setuptools中具有依赖性,如果他们不这样做则无法安装拥有它。
答案 2 :(得分:1)
使用easy_install
安装MyProxyClient时出现类似错误:
“下载错误:未知网址类型:https - 可能找不到某些软件包!”
以及有关未找到openssl标头的其他错误。
所以安装libssl-dev
(在Ubuntu上)为我解决了这个问题!
答案 3 :(得分:1)
Python无法处理https协议,安装openssl-devel包并重新安装python来修复此问题。