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

added upgraded sip qt to setup #579

Merged
merged 2 commits into from
Jan 27, 2022
Merged

added upgraded sip qt to setup #579

merged 2 commits into from
Jan 27, 2022

Conversation

knmcguire
Copy link
Contributor

This fixes the error I had when opening the client in latest version:

PS C:\Users\kimbe\Documents\Development\python\crazyflie-lib-python> cfclient
Traceback (most recent call last):
  File "C:\Python38\Scripts\cfclient-script.py", line 33, in <module>
    sys.exit(load_entry_point('cfclient', 'console_scripts', 'cfclient')())
  File "C:\Python38\Scripts\cfclient-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "c:\python38\lib\importlib\metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\users\kimbe\documents\development\python\crazyflie-clients-python\src\cfclient\gui.py", line 39, in <module>
    from asyncqt import QEventLoop
  File "c:\python38\lib\site-packages\asyncqt\__init__.py", line 60, in <module>
    QtCore = importlib.import_module(QtModuleName + '.QtCore', package=QtModuleName)
  File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
RuntimeError: the sip module implements API v12.0 to v12.8 but the PyQt5.QtCore module requires API v12.9

After I updated the following:

pip install PyQt5-sip --upgrade
pip install sip --upgrade

it all went better again. So I updated setup.py to contain:

  • sip-6.5.0
  • PyQt5-sip-12.9.0

@ataffanel
Copy link
Member

Did you pip install -e . before trying to manually update the dependencies? As far as I can tell pyqt5-sip is a dependency of pyqt5 so it should have been updated automatically to a compatible version: https://libraries.io/pypi/PyQt5.

I am not sure about Sip (it is not a dependency of pyqt5 and I do not have it installed on my windows where the client works), but I do not think we should add pyqt5-sip as our dependency, this will break things the next time pyqt5 is updated.

Copy link
Member

@ataffanel ataffanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment. I do not think this change is required. What version where you running before, can we reproduce the behavior?

@knmcguire
Copy link
Contributor Author

Hi, I've did the install of -e already after first uninstalling previous install of cflib and cfclient. Problem that on my machine it didn't install the right qt-sip.

I was running cfclient 2021.04 before.

@knmcguire
Copy link
Contributor Author

I think the key is this error:

RuntimeError: the sip module implements API v12.0 to v12.8 but the PyQt5.QtCore module requires API v12.9

but pyqt5~=5.15.0 has PyQt5sip >=12.8 as requirement, while it should be 12.9. So I do think we should do at least PyQt5-sip>=12.9.0

@knmcguire
Copy link
Contributor Author

I just verified when I downgraded my PyQt5sip to 12.8, then I was able to recreate the error

@knmcguire
Copy link
Contributor Author

Btw, I had the same thing happening with Ubuntu so this is not a windows error. So since the setup.py of our version for pyqt5 is wrong, so we should probably enforce that constraint of pyqt5-sip always being same or higher than 12.9?

@ataffanel ataffanel self-requested a review January 27, 2022 11:58
Copy link
Member

@ataffanel ataffanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Great finding!

@knmcguire knmcguire merged commit ab4b165 into master Jan 27, 2022
@krichardsson krichardsson added this to the 2022.01 milestone Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants