python模块安装工具--pip

  1. 更新pip
    python.exe -m pip install --upgrade pip

    注意:使用pip语句命令时若出现找不到该命令,在前面加上python -m

    例如:python3 -m pip3 list

  2. 显示pip信息
    pip2 show pip
    pip3 show pip

  3. 查看可升级的包
    pip list -o

  4. 镜像文件安装

   pip2 install tensorflow==1.9 -i https://pypi.douban.com/simple
   pip3 install PyQt5-tools -i https://pypi.tuna.tsinghua.edu.cn/simple
  1. 点击这个网站查看自己所需的Python包及相关依赖的包

  2. 获得帮助提示:pip -h

  3. 创建setup.py文件: py2applet --make-setup function.py

  4. 国内的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

  5. 打印第三方库到 txt 文件
    pip freeze > requirements.txt
    之后会在该目录下生成 requirements.txt 文件

posted @ 2020-07-08 13:28  aJream  阅读(27)  评论(0编辑  收藏  举报