[PyQt] Unable to install PyQt 5.14
sda at fstab.net
Mon Apr 6 14:15:10 BST 2020
On 2020-04-05 22:02, ashwin .D wrote:
> I am trying to install PyQt 5.14 and I am getting the following errors
> when I type this command on Ubuntu 18.04 LTS
> pip3 install PyQt
> Collecting PyQt5
> Using cached
> Complete output from command python setup.py egg_info:
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "/usr/lib/python3.6/tokenize.py", line 452, in open
> buffer = _builtin_open(filename, 'rb')
> FileNotFoundError: [Errno 2] No such file or directory:
> Command "python setup.py egg_info" failed with error code 1 in
> Alternatively I typed
> python3.6 -m pip install.
> and I get a message saying that setup.py is not found.
I would strongly suggest you stop running your system pip. pip should
be run from an isolated environment such as a virtualenv or venv.
https://bit.ly/py-env provides an intro. A tl;dr is below. The point
is that when you install into your system Python's environment you are
mixing with the apt provided packages. This mixing of package managers
leaves neither in complete control and yields potentially incompatible
versions of packages. --user only hazards this for the current user.
Running pip with sudo or otherwise as root hazards breaking your whole
sudo apt install virtualenv
virtualenv -p python3 myvenv
myvenv/bin/pip install --upgrade pip setuptools wheel
myvenv/bin/pip install pyqt5
If there are aspects of this that you find problematic, let us know.
There are lots of options but envs are a very useful thing to use.
Some people will push for venv rather than virtualenv. No matter, I use
them more or less interchangeably. Due to how Ubuntu has things
packaged (inherited from Debian if I remember correctly) you have to
install multiple system packages to get the 'it is just built-in with
Python' venv module to actually work. On the flip side, installing
virtualenv actually just works as I recall.
More information about the PyQt