Ubuntu18.04安装PyQt5时报如下错误,在网上找了好一阵才找到一个靠谱的答案
$ pip install PyQt5
Collecting PyQt5
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4d/81/b9a66a28fb9a7bbeb60e266f06ebc4703e7e42b99e3609bf1b58ddd232b9/PyQt5-5.14.2.tar.gz
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: '/tmp/pip-build-bvt34c2g/PyQt5/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bvt34c2g/PyQt5/
答案引自https://stackoverflow.com/questions/59711301/install-pyqt5-5-14-1-on-linux
sudo apt-get update && \
apt-get autoclean
sudo apt-get update && apt-get install \
-y --no-install-recommends \
python3-pip \
python3-setuptools
sudo python3 -m pip install pyqt5==5.14 pyqtchart==5.14
或者降低版本pip install pyqt5==5.10 pyqtchart==5.10