0

I would like to use PyQt with some Qt Creator.

How many and which packages I have to install?

$ sudo apt-get install qtcreator

If I install just qtcreator, do I have to install also PyQt?

$ sudo pip3 install PyQt5

Are these two commands only?

2 Answers 2

1

In Ubuntu 18.04 open the terminal and type:

sudo apt install qtcreator python3-pyqt5  

Optionally you can also install python-pyqt5.

0

If you're on bionic and you do find out PyQt5 is needed alongside Qt Company's pyside2, instead of using sudo issue the pip3 commmand at the prompt for the user who will use the package with the --user switch:

$ pip3 install --user PyQt5

For PySide2, you can find more information under the heading 'Development: Getting Started' here: https://wiki.qt.io/Qt_for_Python

Many popular Python packages, including the core Python packages, are made available by way of your Ubuntu distribution's repo. The caveat is Python core modules like Idle and pip, elements core to the language, must be found so that a complete installation can be assembled. Docs, for instance must be installed separately, and python3-pip installed to get pip3 must be installed separately or by installing python3-setuptools. Consequently, there is what amounts to misinformation about installing Python modules for Python on various flavours of Ubuntu, even in very well documented and active projects. It isn't sufficient to pip install when doing so may break your pip installation, forcing you to clear and reinstall it.

It is a safe bet that if you can find the package you're looking for in an Ubuntu repo for your distribution, you should install it -- that way. Otherwise, the --user switch is your friend.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .