python模块安装工具--pip
-
更新pip
python.exe -m pip install --upgrade pip
注意:使用pip语句命令时若出现找不到该命令,在前面加上
python -m
例如:
python3 -m pip3 list
-
显示pip信息
pip2 show pip
pip3 show pip
-
查看可升级的包
pip list -o
-
镜像文件安装
pip2 install tensorflow==1.9 -i https://pypi.douban.com/simple
pip3 install PyQt5-tools -i https://pypi.tuna.tsinghua.edu.cn/simple
-
点击这个网站查看自己所需的Python包及相关依赖的包
-
获得帮助提示:
pip -h
-
创建setup.py文件:
py2applet --make-setup function.py
-
国内的pip源,如下:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
使用方法:
pip install web.py -i http://pypi.douban.com/simple
-
打印第三方库到 txt 文件
pip freeze > requirements.txt
之后会在该目录下生成requirements.txt
文件
本文来自博客园,作者:aJream,转载请记得标明出处:https://www.cnblogs.com/ajream/p/15383620.html