Context

I wanted to install PyQt5 in my conda base environment, along with some other libraries. I have completed this task in different sessions. The problem is that when I went in Visual Studio Code and imported all my libraries in a python file, my linter could not resolve missing imports from PyQt5 alone. I have checked that the chosen interpreter in the IDE is the one of the base environment of anaconda3. So I think I had installed PyQt5 while my conda was not active (as I had been playing with that for a while). I then installed it in my conda environment, so now everything is fine, except for the fact that I may have more than one copy of PyQt5 installed, and this is not ideal. I would like to understand what I actually have done and have stored in my Ubuntu partition, more for the sake of knowledge than for getting back some disk space.

Shell-based disk inspection

I have collected some info about my installations, and I report them here in order to help you have a grasp of what is inside my Ubuntu isntallation. All the next commands have been executed while in the base conda environment.

$conda list | grep -e qt5 -e Qt5 pyqt5 5.15.4 pypi_0 pypi pyqt5-qt5 5.15.2 pypi_0 pypi pyqt5-sip 12.8.1 pypi_0 pypi 
$pip install pyqt5 Requirement already satisfied: pyqt5 in ./anaconda3/lib/python3.8/site-packages (5.15.4) Requirement already satisfied: PyQt5-Qt5>=5.15 in ./anaconda3/lib/python3.8/site-packages (from pyqt5) (5.15.2) Requirement already satisfied: PyQt5-sip<13,>=12.8 in ./anaconda3/lib/python3.8/site-packages (from pyqt5) (12.8.1) 
$ dpkg --list | grep -e qt5 -e Qt5 ii libpyside2-dev 5.14.0-1~exp1ubuntu5 amd64 Python bindings for Qt5 (development files) ii libpyside2-py3-5.14 5.14.0-1~exp1ubuntu5 amd64 Python 3 bindings for Qt5 (base files) ii libqt5concurrent5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 concurrent module ii libqt5core5a:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 core module ii libqt5dbus5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 D-Bus module ii libqt5designer5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 designer module ii libqt5designercomponents5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 Designer components module ii libqt5gui5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 GUI module ii libqt5help5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 help module ii libqt5network5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 network module ii libqt5opengl5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 OpenGL module ii libqt5opengl5-dev:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 OpenGL library development files ii libqt5positioning5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt Positioning module ii libqt5printsupport5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 print support module ii libqt5qml5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 QML module ii libqt5quick5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 Quick library ii libqt5quickparticles5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 Quick particles module ii libqt5quickshapes5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 Quick Shapes module ii libqt5quicktest5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 Quick Test library ii libqt5quickwidgets5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 Quick Widgets library ii libqt5sensors5:amd64 5.12.8-0ubuntu1 amd64 Qt Sensors module ii libqt5sql5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 SQL module ii libqt5sql5-sqlite:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 SQLite 3 database driver ii libqt5svg5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 SVG module ii libqt5test5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 test module ii libqt5webchannel5:amd64 5.12.8-0ubuntu1 amd64 Web communication library for Qt ii libqt5webkit5:amd64 5.212.0~alpha4-1ubuntu2 amd64 Web content engine library for Qt ii libqt5webkit5-dev:amd64 5.212.0~alpha4-1ubuntu2 amd64 Web content engine library for Qt - development files ii libqt5widgets5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 widgets module ii libqt5x11extras5:amd64 5.12.8-0ubuntu1 amd64 Qt 5 X11 extras ii libqt5xml5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 XML module ii libqwt-qt5-6 6.1.4-1.1build1 amd64 Qt widgets library for technical applications (runtime, qt5) ii libqwt-qt5-dev 6.1.4-1.1build1 amd64 Qt widgets library for technical applications (development, qt5) ii pyqt5-dev 5.14.1+dfsg-3build1 all Development files for PyQt5 ii python3-pyqt5 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5 ii python3-pyqt5.qtopengl 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5's OpenGL module ii python3-pyqt5.qtsvg 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5's SVG module ii python3-pyqt5.qtwebkit 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5's WebKit module ii python3-pyside2.qtcore 5.14.0-1~exp1ubuntu5 amd64 Python bindings for Qt5 core module (Python 3) ii python3-pyside2.qtgui 5.14.0-1~exp1ubuntu5 amd64 Python bindings for Qt5 Gui module (Python 3) ii python3-pyside2.qtsvg 5.14.0-1~exp1ubuntu5 amd64 Python bindings for Qt5 Svg module (Python 3) ii python3-pyside2.qtwidgets 5.14.0-1~exp1ubuntu5 amd64 Python bindings for Qt5 Widgets module (Python 3) ii qdoc-qt5 5.12.8-0ubuntu1 amd64 Qt 5 qdoc tool ii qhelpgenerator-qt5 5.12.8-0ubuntu1 amd64 Qt 5 qhelpgenerator tool ii qt5-assistant 5.12.8-0ubuntu1 amd64 Qt 5 Assistant ii qt5-gtk-platformtheme:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 GTK+ 3 platform theme ii qt5-qmake:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 qmake Makefile generator tool ii qt5-qmake-bin 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 qmake Makefile generator tool — binary file ii qt5-qmltooling-plugins:amd64 5.12.8-0ubuntu1 amd64 Qt 5 qmltooling plugins ii qtattributionsscanner-qt5 5.12.8-0ubuntu1 amd64 Qt 5 qtattributionsscanner tool 

Sorry for the not-so-precise grep, but I am not that good with it. Furthermore, I suspect I have even more Qt stuff as, as I just discovered, there are some Qt entries in my apps list, and I do not think they come in the system by default, nor they are strictly python-related. Maybe they are listed in dpkg --list | grep -e qt5 -e Qt5, but I cannot undestand it. I also attach part of my shell history, in case it helps better understanding what I have done:

$ history | grep -e qt5 -e Qt5 1795 conda install PyQt5 1796 pip install PyQt5 1799 pip remove PyQt5 1800 pip uninstall PyQt5 1805 sudo apt-get install python3-pyqt5 1855 conda install PyQt5 1877 conda install pyqt5 1881 pip uninstall pyqt5 1885 conda uninstall PyQt5 1892 pip install PyQt5 1938 pip install pyqt5 1939 pip install PyQt5 

from which I removed all the unnecessary commands (e.g. history ones). Anyway, I think I was at 1797-1798 in terms of history commands when my Python in the base conda environment could not see the Qt5 library (see previous section)

What I want

It is clear that I am not fully understanding what I am doing, so I would like to receive some insights. I would also like to better understand how to determine if a package listed in dpkg or in conda is actually just a portion of another, like for example all the above instances of pyqt5-sip, as I am 100% sure of never have written "sip" in my terminal.

Thank you!

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy