[Distutils] install_requires setup.py install vs pip install
Leonardo Rochael Almeida
leorochael at gmail.com
Tue Mar 7 09:38:34 EST 2017
The reason setuptools can't process your package is because setuptools
itself doesn't yet know how to install wheels which pip knows how to
install, and PyQT5 is only available as wheels on PyPI (the files with
`.whl` extension in the `simple` URL you linked).
The reason why setuptools can install "requests" or "simplejson" is that
their pages contain `.tar.gz` files with the source distributions beside
the `.whl` files.
Incidentally, there are PyQT5 source distributions, and they're available
in their own website.
IMO they should be present in PyPI as well.
(Though those archive names with `_gpl` in the middle might confuse
setuptools, and they might prefer to deal with "Could not find suitable
distribution" error message than some obscure compilation error arising
from missing system packages).
On 7 March 2017 at 11:24, Tim Golden <mail at timgolden.me.uk> wrote:
> I have a setup.py which looks like this:
> from setuptools import setup
> py_modules = ["install_requires"],
> For the purposes of the discussion, there is an install_requires.py in the
> same directory.
> I have created and activated a standard Python 3.5 venv on Windows:
> py -3.5 -mvenv .venv
> python -mpip install --upgrade pip
> (I don't believe the Python version or the venv matter here, but including
> them for reproducibility).
> If I pip install the module, the PyQt5 install dependency is found and
> (.venv) C:\work-in-progress\install_requires>pip install .
> Processing c:\work-in-progress\install_requires
> Collecting PyQt5 (from install-requires==0.0.0)
> Using cached PyQt5-5.8.1-5.8.0-cp35.cp36.cp37-none-win_amd64.whl
> Collecting sip==4.19 (from PyQt5->install-requires==0.0.0)
> Using cached sip-4.19-cp35-none-win_amd64.whl
> Installing collected packages: sip, PyQt5, install-requires
> Running setup.py install for install-requires ... done
> Successfully installed PyQt5-5.8.1 install-requires-0.0.0 sip-4.19
> If, instead, I setup.py install the module, I get the following messages:
> Processing dependencies for install-requires==0.0.0
> Searching for PyQt5
> Reading https://pypi.python.org/simple/PyQt5/
> No local packages or download links found for PyQt5
> error: Could not find suitable distribution for Requirement.parse('PyQt5')
> However, if I substitute instead "requests" or "simplejson" (both
> well-known packages) then setup.py install succeeds. My cursory inspection
> of https://pypi.python.org/simple/pyqt5/ doesn't reveal anything
> obviously different except for the complexity of the filenames.
> I've searched around, including in the archives of this group, but can't
> find that this is a known issue. If I had to guess from the evidence, it
> would be that pip ships a more sophisticated parser of complex wheel
> filenames than setuptools.
> Can anyone advise, please?
> Distutils-SIG maillist - Distutils-SIG at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Distutils-SIG