2011-07-28 170 views
8

我想列出ScientificPython作为我的setup.py中的依赖项。但是,在安装过程中,python似乎找不到该软件包。我的方法有什么问题?安装ScientificPython作为依赖关系

这里是我的设置:

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' 

也许一个问题是,ScientificPython在某种程度上虽然PyPI无法访问,或者至少不能下载,因为easy_install ScentificPython将会以No local packages or download links found for ScentificPython失败。

为了用setuptools安装ScientificPython,我需要做些什么?

+0

出于好奇,为什么不'scipy'? – katrielalex

+0

@katrielalex由于某种原因,我以前的开发人员参加了ScientificPython。因此,重写模块以使用scipy将是很多工作。另外,我不确定安装scipy有多么困难/容易,尤其是关于lapack绑定... – Woltan

回答

2

问题在于它试图建立到https站点的http连接。从我可以告诉setuptools不支持到https的连接。你将不得不使用另一种方法来获取这些包。

如果你想使用setuptools,我的建议是你在文件的README文件中详细说明他们必须下载该依赖并安装它,然后在setuptools中有依赖项,如果他们不没有。大约找不到OpenSSL的头

"Download error: unknown url type: https -- Some packages may not be found!"

和其他错误:

+0

这就是假设他们没有没有HTTPS的URL。他们有一个未加密的HTTP目标和文件将是最简单的问题解决方案,可以让你按照你想要的方式实际安装。 – Drahkar

3

您是否尝试将直接下载链接(https://sourcesup.cru.fr/frs/download.php/2309/ScientificPython-2.8.tar.gz)放入dependency_links而不是html页面,因为您的脚本似乎找不到该软件包,然后尝试安装None

编辑:刚才注意到:巨蟒显然是无法打开HTTPS资源 - 尝试地方上载没有HTTPS,使用普通的HTTP

编辑2:你为什么不干脆把整个ScientificPython文件夹到你的分布文件夹,并确保setup.py(或其他你需要调用的)被setup.py调用?

+0

你知道为什么ScientificPython不能通过PyPI安装吗?你可以备份https问题吗? – Woltan

+0

PyPI上的ScientificPython只提供一个到其网站的链接,其中下载链接仅指您已经放入'dependency_links'的下载页面。我不认为python会尝试两次从同一页面下载。 – hlt

1

使用easy_install安装时MyProxyClient我得到类似的错误。

所以安装libssl-dev(在Ubuntu上)解决了我的问题!

1

Python无法处理https协议,请安装openssl-devel软件包并重新安装python以解决此问题。