background:
At work, a virtual machine may be assigned to developers. Developers need to debug, develop, package and other operations on it, which depends on the Python environment.
operate
There are many installation steps online, but the descriptions in many articles are not clear enough. This article is one of the few guidance articles that contains complete steps, and I have collected it.
Third party blogger
Error when installing pipenv
Installation command: pip3 install --user pipenv
Error screenshot:
Solution:
find / -name lsb_release
rm -rf /usr/bin/lsb_release
Successful installation:
pip configures Alibaba Cloud mirror source
Summary of common domestic mirror sources
Tsinghua mirror https://pypi.tuna.tsinghua.edu.cn/simple
University of Science and Technology of China mirror https://pypi.mirrors.ustc.edu.cn/simple
Douban mirror http://pypi.douban.com/simple/Alibaba
mirror https://mirrors.aliyun.com/pypi/simple/Huazhong
University of Science and Technology mirror http://pypi.hustunique.com/Shandong
University of Science and Technology mirror
http://pypi.hustunique.com/Sohu mirror http://mirrors.sohu .com/Python/
Baidu mirror https://mirror.baidu.com/pypi/simple
Linux
Modify ~/.pip/pip.conf (create one if it doesn’t exist), modify index-url, the content is as follows:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
Windows
Create a pip directory directly in the user directory, such as: C:Usersxxpip, and create a new file pip.ini with the following content
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
Please note: You must first create the pip folder under your personal user folder, and then create the pip.ini file. Do not directly place the pip.ini file under C:Usersxx.