[Distutils] install_requires setup.py install vs pip install

Leonardo Rochael Almeida leorochael at gmail.com
Tue Mar 7 09:38:34 EST 2017

Hi Tim,

The reason setuptools can't process your package is because setuptools
itself doesn't yet know how to install wheels[1] 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).

[1] https://github.com/pypa/setuptools/issues/78

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[2].

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).

[2] https://www.riverbankcomputing.com/software/pyqt/download5/



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
> setup(
>     name='install_requires',
>     py_modules = ["install_requires"],
>     install_requires=['PyQt5'],
> )
> 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
> .venv\scripts\activate.bat
> 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
> installed:
> (.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
> https://mail.python.org/mailman/listinfo/distutils-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170307/df68cd52/attachment-0001.html>

More information about the Distutils-SIG mailing list