pip安装软件报错

在安装PyQt5时报错

lytr@ubuntu:~/Downloads$ sudo pip3 install PyQt5
WARNING: The directory '/home/lytr/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: PyQt5 in /usr/local/lib/python3.5/dist-packages (5.14.1)
Requirement already satisfied: PyQt5-sip<13,>=12.7 in /usr/local/lib/python3.5/dist-packages (from PyQt5) (12.7.1)

解决方法:
格式:pip install --target=目标路径 工具包名字

lytr@ubuntu:~/Downloads$ sudo pip3 install --target=/usr/local/lib/python3.5/dist-packages PyQt5 -i https://pypi.douban.com/simple
WARNING: The directory '/home/lytr/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Looking in indexes: https://pypi.douban.com/simple
Collecting PyQt5
  Downloading https://pypi.doubanio.com/packages/bb/47/640737c9d2eb76a2bf6e8dc101dd195caea07985f1932976629c02ad1432/PyQt5-5.14.1-5.14.1-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl (63.5 MB)
     |████████████████████████████████| 63.5 MB 1.3 MB/s 
Collecting PyQt5-sip<13,>=12.7
  Downloading https://pypi.doubanio.com/packages/8f/88/fcb980ac5ca8d2eb84e811825d8267528a18e5531f62d0295c607419c537/PyQt5_sip-12.7.1-cp35-cp35m-manylinux1_x86_64.whl (252 kB)
     |████████████████████████████████| 252 kB 3.6 MB/s 
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.14.1 PyQt5-sip-12.7.1

你可能感兴趣的:(code,python)