【问题标题】:Installing ScientificPython as a dependency将 ScientificPython 作为依赖项安装
【发布时间】:2011-10-15 04:02:31
【问题描述】:

我试图在我的setup.py 中将ScientificPython 列为依赖项。但是,在安装过程中,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'

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

要使用 setuptools 安装 ScientificPython,我需要做什么?

【问题讨论】:

  • 出于好奇,为什么不scipy
  • @katrielalex 出于某种原因,我以前的开发人员选择了 ScientificPython。因此,重写模块以使用 scipy 将是很多工作。另外,我不确定安装 scipy 有多难/容易,尤其是在 lapack 绑定方面……

标签: python installation dependencies package setuptools


【解决方案1】:

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

编辑:刚刚注意到:python 显然无法打开 https 资源 - 尝试使用普通 http 在没有 https 的地方上传它

编辑 2:为什么不将整个 ScientificPython 文件夹放入分发文件夹并确保 setup.py 调用它的 setup.py(或您需要调用的任何其他内容)?

【讨论】:

  • 你知道为什么ScientificPython不能通过PyPI安装吗?你能备份 https 问题吗?
  • ScientificPython on PyPI 仅提供其网站的链接,其中下载链接仅指您已放入 dependency_links 的下载页面。我不认为 python 会尝试两次从同一页面下载。
【解决方案2】:

问题在于它试图与 https 站点建立 http 连接。据我所知,setuptools 不支持到 https 的连接。您将不得不使用另一种方法来获取这些包。

如果您想使用 setuptools,我的建议是您在 README 中详细说明他们必须下载该依赖项并安装它的文件,然后在 setuptools 中安装依赖项,如果他们不这样做,则安装失败'没有。

【讨论】:

  • 假设他们没有没有 HTTPS 的 URL。他们有一个带有文件的未加密 HTTP 目标将是解决问题的最简单的解决方案,它允许您以您想要的方式实际进行安装。
【解决方案3】:

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

【讨论】:

    【解决方案4】:

    我在使用 easy_install 安装 MyProxyClient 时遇到了类似的错误:

    “下载错误:未知url类型:https--某些包可能找不到!”

    以及其他关于找不到 openssl 标头的错误。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-29
      • 2016-08-21
      • 2021-10-15
      • 2012-02-01
      • 2019-12-03
      • 2014-08-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多