pip使用

一、参考

二、设置pip国内源

配置为阿里源

# cat ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

三、常见报错

# 终端命令
pip3 install requirements.txt

# 返回报错
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
ERROR: Could not find a version that satisfies the requirement requirements.txt
ERROR: No matching distribution found for requirements.txt

报错原因是 pip install -r requirements.txt, 需要指定install参数

原文地址:https://www.cnblogs.com/thewindyz/p/14148801.html