开发者

Installing ScientificPython as a dependency

开发者 https://www.devze.com 2023-03-23 18:54 出处:网络
I am trying to list ScientificPython as a dependency in my setup.py. However, during the installation process, python seems to not find the package. What is wrong in my approach?

I am trying to list ScientificPython as a dependency in my setup.py. However, during the installation process, python seems to not find the package. What is wrong in my approach?

Here is my setup:

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"])

And this is the important part of the output when I run 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/pytho开发者_JAVA技巧n2.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'

Maybe one issue is, that ScientificPython is somehow not accessible though PyPI, or at least not downloadable as easy_install ScentificPython will fail with No local packages or download links found for ScentificPython.

What do I need to do in order to install ScientificPython with setuptools?


Have you tried putting the direct download link (https://sourcesup.cru.fr/frs/download.php/2309/ScientificPython-2.8.tar.gz) into the dependency_links rather than the html page as your script seems not to find the package and then tries to install None.

edit: just noticed: python apparently is not able to open https resources - try uploading it somewhere without https, using normal http

edit 2: Why don't you just put the whole ScientificPython folder into your distribution folder and make sure its setup.py (or whatever else you need to call) is called by your setup.py?


The problem is specifically that its trying to make an http connection to a https site. From what I can tell setuptools does not support connections to https. You're going to have to use another method for getting those packages.

My recommendation, if you want to use setuptools, is that you detail in the README for the file that they have to download that dependency and install it and then have the dependency in the setuptools that fails to the install if they don't have it.


Python is unable to handle https protocol, install openssl-devel package and reinstall the python to fix this.


I was getting similar error when installing MyProxyClient using easy_install:

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

and other errors about not finding openssl headers.

So installing libssl-dev (on Ubuntu) solved the problem for me!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号