I am trying to setup a Bitbucket pipeline for my python project, but getting errors that do not appear on my local machine.
E0401: Unable to import 'PyQt5.QtWidgets' (import-error) E0611: No name 'QtWidgets' in module 'PyQt5' (no-name-in-module)
Locally (windows), I am able to get rid of no-name-in-module errors using --extension-pkg-whitelist=PyQt5.
image: python:3.11.4
pipelines:
default:
- parallel:
- step:
name: Run pylint
script:
- pip install -r requirements.txt
- pylint source --fail-under=9 --extension-pkg-whitelist=PyQt5
I have tried:
Guess this is somehow related to how Qt is installed/imported in Linux since I am not able to reproduce the import-error locally?
Edit: I have also tried to install PyQt using apt-get install python3-pyqt5 since it was suggested as a fix for import error in other question. That resulted in Unable to locate package python3-pyqt5
The message Unable to locate package python3-pyqt5
means that the system install of pyqt5 failed, you need to find what is the name of this dependency in your system or why it's failing. Seeing that the name seems to be the right one (https://packages.debian.org/search?keywords=python3-pyqt5), you might need to do an apt update
first.