镜像加速

#使用镜像加速下载
python3 -m pip install --upgrade pip -i https://pypi.douban.com/simple
#更换方案
pip install --upgrade pip -i https://pypi.douban.com/simple/
pip3 install --upgrade pip -i https://pypi.douban.com/simple/


#清华大学源
https://pypi.tuna.tsinghua.edu.cn/simple
#阿里
https://mirrors.aliyun.com/pypi/simple/
#豆瓣
https://pypi.douban.com/simple

安装库

#格式一
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 库名
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyecharts
#格式二
pip3 install tensorflow==2.6  --index-url https://mirrors.aliyun.com/pypi/simple/  --trusted-host mirrors.aliyun.com/ 
pip3 install tensorflow==2.6  --index-url https://pypi.tuna.tsinghua.edu.cn/simple

实例


pip install jieba==0.42.1 -i https://pypi.douban.com/simple

#requirements
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
pip install -r /tmp/requirements.txt -i https://mirrors.aliyun.com/pypi/simple

pip卸载库

pip uninstall docker-compose

常用命令

pip list 
pip list
pip show numpy
pip install pymysql
pip install pymysql==0.9.3
pip uninstall pymysql