1. Slow speed when installing python package - add domestic agent.
pip install PyQt5
命令格式:
pip install -i 镜像地址 包名
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ PyQt5
常用国内镜像地址:
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
豆瓣网:https://pypi.douban.com/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
2. Batch import and export of packages in files
1. Export installation packages in batches
终端-路径- pip freeze > requirements.txt(导出包)
2. Import installation packages in batches
终端 - 路径 - pip install -r requirements.txt (安装文件中包)
终端-路径- pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt