查看电脑上装了几个python环境
py -0
可以查看安装目录
where python
安装虚拟环境
python -m venv venv_file_name
安装pip
python -m ensurepip --default-pip
升级pip
python -m pip install –upgrade pip
pip install -U pip
卸载pip
python -m pip uninstall pip
下载三方包并修改源地址
pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com pkg_name
安装指定版本的包
pip install pkg_name==3.4.1
卸载包
pip uninstall pkg_name
更新包
pip install -U pkg_name
pip install --upgrade pkg_name
生成依赖包文件列表
pip freeze > pkg.txt
批量安装依赖
pip install –r pkg.txt
下载包但不安装
pip install <包名> -d <目录>
pip install -d <目录> -r requirements.txt
pip源
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/