# 查找软件
pip search Package
# 安装软件
pip install Package
# 使用临时地址安装软件
pip install -i src Package
# 更新软件
pip install -U Package
# 卸载软件
pip uninstall Package
# 列出已安装的软件
pip list
# 下载
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# 安装
python3 get-pip.py
# 没有则新建pip.conf
mkdir ~/.pip && cd ~/.pip && touch pip.conf
# 编辑
gedit pip.conf
# 填入下面配置
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
# 使用 `pip -v config list` 查看配置文件目录
# 类似如下结果
For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\Administrator\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\Administrator\AppData\Roaming\pip\pip.ini'
For variant 'site', will try loading 'C:\ProgramData\anaconda3\pip.ini'
# 然后在Administrator下新建目路pip
# 新建文件pip.ini
# 编辑文件,填入,保存
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
# 错误提示如下:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
# 进入/usr/bin/pip3,调整为
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())