Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry doesn't fully add some packages (PyQt5, Jupyter) #314

Closed
2 of 3 tasks
patarapolw opened this issue Jul 17, 2018 · 6 comments
Closed
2 of 3 tasks

Poetry doesn't fully add some packages (PyQt5, Jupyter) #314

patarapolw opened this issue Jul 17, 2018 · 6 comments
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected

Comments

@patarapolw
Copy link

patarapolw commented Jul 17, 2018

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

I have to pip install pyqt5 to get pyqt5-sip

(TagDict) Pacharapols-Air:TagDict patarapolw$ python -m desktop
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/patarapolw/PycharmProjects/TagDict/desktop/__main__.py", line 1, in <module>
    from .controller import main
  File "/Users/patarapolw/PycharmProjects/TagDict/desktop/controller.py", line 3, in <module>
    from PyQt5.QtGui import QGuiApplication
ModuleNotFoundError: No module named 'PyQt5.sip'
(TagDict) Pacharapols-Air:TagDict patarapolw$ pip install pyqt5
Requirement already satisfied: pyqt5 in /Users/patarapolw/.local/share/virtualenvs/TagDict/lib/python3.7/site-packages (5.11.2)
Collecting PyQt5_sip<4.20,>=4.19.11 (from pyqt5)
  Downloading https://files.pythonhosted.org/packages/3c/5f/80690ffa65d12cd5977a49d68735d62304f709c32b80b212a1b045523c8d/PyQt5_sip-4.19.12-cp37-cp37m-macosx_10_6_intel.whl (51kB)
    100% |████████████████████████████████| 61kB 93kB/s 
poetry 0.11.2 requires cachecontrol[filecache]<0.13.0,>=0.12.4, which is not installed.
poetry 0.11.2 requires cachy<0.3,>=0.2, which is not installed.
poetry 0.11.2 requires cleo<0.7.0,>=0.6.7, which is not installed.
poetry 0.11.2 requires pkginfo<2.0,>=1.4, which is not installed.
poetry 0.11.2 requires pyparsing<3.0,>=2.2, which is not installed.
poetry 0.11.2 requires pyrsistent<0.15.0,>=0.14.2, which is not installed.
poetry 0.11.2 requires pytoml<0.2.0,>=0.1.16, which is not installed.
poetry 0.11.2 requires requests<3.0,>=2.18, which is not installed.
poetry 0.11.2 requires requests-toolbelt<0.9.0,>=0.8.0, which is not installed.
poetry 0.11.2 requires shellingham<2.0,>=1.1, which is not installed.
jupyter 1.0.0 requires ipywidgets, which is not installed.
jupyter 1.0.0 requires jupyter-console, which is not installed.
jupyter 1.0.0 requires qtconsole, which is not installed.
Installing collected packages: PyQt5-sip
Successfully installed PyQt5-sip-4.19.12
(TagDict) Pacharapols-Air:TagDict patarapolw$ 

Now it works.

About Jupyter Notebook, even though it seems not completely installed, I can use it without problems.

@sdispater
Copy link
Member

I think this is a similar case to #301.

See #301 (comment) for an explanation about what happens.

@sdispater sdispater added kind/bug Something isn't working as expected area/solver Related to the dependency resolver labels Jul 17, 2018
@sdispater
Copy link
Member

Ok I tracked down the issue and the issue resides upstream.

Basically the wheels for pyqt5 specify metadata in version 1.1 but their dependencies are declared using Requires-Dist which is only valid for the metadata specification 1.2+ this is why Poetry doesn't pick up pyqt5-sip.

Here is the complete METADATA file:

Metadata-Version: 1.1
Name: PyQt5
Version: 5.11.2
Summary: Python bindings for the Qt cross platform UI and application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-email: info@riverbankcomputing.com
License: GPL v3
Platform: UNIX
Platform: OS X
Platform: Windows
Platform: iOS
Platform: Android
Requires-Dist: PyQt5_sip (>=4.19.11, <4.20)

PyQt5 - Comprehensive Python Bindings for Qt v5
===============================================

What is PyQt5?
--------------

Qt is set of cross-platform C++ libraries that implement high-level APIs for
accessing many aspects of modern desktop and mobile systems.  These include
location and positioning services, multimedia, NFC and Bluetooth connectivity,
a Chromium based web browser, as well as traditional UI development.

PyQt5 is a comprehensive set of Python bindings for Qt v5.  It is implemented
as more than 35 extension modules and enables Python to be used as an
alternative application development language to C++ on all supported platforms
including iOS and Android.

PyQt5 may also be embedded in C++ based applications to allow users of those
applications to configure or enhance the functionality of those applications.


Author
------

PyQt5 is copyright (c) Riverbank Computing Limited.  Its homepage is
https://www.riverbankcomputing.com/software/pyqt/.

Support may be obtained from the PyQt mailing list at
https://www.riverbankcomputing.com/mailman/listinfo/pyqt/.


License
-------

PyQt5 is released under the GPL v3 license and under a commercial license that
allows for the development of proprietary applications.


Installation
------------

PyQt5 source packages for the GPL version can be dowloaded from
https://www.riverbankcomputing.com/software/pyqt/download5/.

Wheels for the GPL version for 32 and 64-bit Windows, 64-bit OS X and 64-bit
Linux can be installed from PyPI::

    pip3 install PyQt5

The wheels include a copy of the required parts of the LGPL version of Qt.


Documentation
-------------

The documentation for the latest release can be found
`here <http://pyqt.sourceforge.net/Docs/PyQt5/>`__.

As such, the issue should be reported upstream.

For the time being you can add pyqt5-sip to your own dependencies.

@patarapolw
Copy link
Author

For the time being you can add pyqt5-sip to your own dependencies.

It seems that "I can" means "I have to": https://github.com/patarapolw/SimpleCel/blob/master/pyproject.toml#L15 because it is not working as of now.

@lochsh
Copy link

lochsh commented Jan 7, 2022

PyQt seem to have fixed the issue with their metadata version, but poetry still fails to install pyqt5-qt and pyqt5-sip.

The metadata now:

Metadata-Version: 2.1
Name: PyQt5
Version: 5.15.6
Requires-Python: >=3.6
Summary: Python bindings for the Qt cross platform application toolkit
Home-Page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-Email: info@riverbankcomputing.com
License: GPL v3
Requires-Dist: PyQt5-sip (>=12.8, <13)
Requires-Dist: PyQt5-Qt5 (>=5.15.2)

Installing with pip successfully installs pyqt5-sip and pyqt5-qt5, and pyqt5 no longer errors trying to find Qt libraries. Could this be an issue with poetry?

I can confirm that doing poetry add pyqt5-sip pyqt5-qt5 resolves the issue, for anyone coming across this page, but obviously it would be better to not have to specify these manually.

tcompa added a commit to fractal-analytics-platform/fractal-client that referenced this issue Aug 22, 2022
@BenWhetton
Copy link

I just bumped into this bug when migrating to poetry. It looks like Poetry is still failing to install PyQt5-Qt5 even though the metadata file appears to be correct now (as far as I can tell).

@sdispater Can we re-open this ticket, or should I make a new one?

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants