解决pip无法升级以及PyHamcrest无法安装问题

最近调试PaddlePaddle调试语音转写及TTS功能。Paddle需要安装要求pip版本为20.2.2或更高版本。还需要安装PyHamcrest。

但是目前访问pip的官网非常的慢,更新几乎完成不了。

采用python -m ensurepip,但是报如下错误:

twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed

采用pip install pip -U,解决pip版本升级问题

[root@system-2-new bin]# pip install pip -U
Collecting pip
Downloading https://files.pythonhosted.org/packages/6a/df/a6ef77a6574781a668791419ffe366c8acd1c3cf4709d210cb53cd5ce1c2/pip-22.0.3-py3-none-any.whl (2.1MB)
100% |████████████████████████████████| 2.1MB 12.4MB/s
twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed.

Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-22.0.3

设置清华镜像,解决PyHamcrest包安装问题

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

[root@system-2-new bin]# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple PyHamcrest

[root@system-2-new bin]# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple PyHamcrest
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting PyHamcrest
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5a/fa/488920633f45c1c291c633fcbe0cd465f40d91ac2a2b90f594bae36db80a/PyHamcrest-2.0.3-py3-none-any.whl (51 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.9/51.9 KB 6.0 MB/s eta 0:00:00
Installing collected packages: PyHamcrest
Successfully installed PyHamcrest-2.0.3
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[root@system-2-new bin]# python -m ensurepip
Looking in links: /tmp/tmps785zwtp
Requirement already satisfied: setuptools in /usr/anaconda3/lib/python3.7/site-packages (40.2.0)
Requirement already satisfied: pip in /usr/anaconda3/lib/python3.7/site-packages (22.0.3)

[paddle@system-2-new ~]$ python -m pip install paddlepaddle==2.2.2 -i https://mirror.baidu.com/pypi/simple
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://mirror.baidu.com/pypi/simple
Collecting paddlepaddle==2.2.2
Using cached https://mirror.baidu.com/pypi/packages/e4/42/3a91bff89038a9773b2df69610293e759ed6e1de6fe115503d1132805103/paddlepaddle-2.2.2-cp37-cp37m-manylinux1_x86_64.whl (108.4 MB)
Requirement already satisfied: decorator in /usr/anaconda3/lib/python3.7/site-packages (from paddlepaddle==2.2.2) (4.3.0)
Requirement already satisfied: Pillow in /usr/anaconda3/lib/python3.7/site-packages (from paddlepaddle==2.2.2) (5.2.0)
Collecting requests>=2.20.0
Using cached https://mirror.baidu.com/pypi/packages/2d/61/08076519c80041bc0ffa1a8af0cbd3bf3e2b62af10435d269a9d0f40564d/requests-2.27.1-py2.py3-none-any.whl (63 kB)
Requirement already satisfied: six in /usr/anaconda3/lib/python3.7/site-packages (from paddlepaddle==2.2.2) (1.11.0)
Collecting astor
Using cached https://mirror.baidu.com/pypi/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl (27 kB)
Requirement already satisfied: numpy>=1.13 in /usr/anaconda3/lib/python3.7/site-packages (from paddlepaddle==2.2.2) (1.15.1)
Collecting protobuf>=3.1.0
Downloading https://mirror.baidu.com/pypi/packages/03/6b/12b307892ef5e9f4a1a92f5996922561c453540f5ce22a09038d2486b451/protobuf-3.19.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 6.1 MB/s eta 0:00:00
Requirement already satisfied: idna

Original: https://blog.csdn.net/lzyzuixin/article/details/123110918
Author: 醉心编码
Title: 解决pip无法升级以及PyHamcrest无法安装问题

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/527205/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球