Python pip 查看、更新、安装模块

Python pip 查看、更新、安装模块

查看已安装模块

刚安装好Python 里面只有pip 和setuptools ,而且还有个警告,提醒pip 需要从20.2.3 升级到20.2.4

C:\Users\herion>pip list
Package    Version
---------- -------
pip        20.2.3
setuptools 49.2.1
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the 'd:\develop\python\python.exe -m pip install --upgrade pip' command.

pip 模块升级

执行升级命令

执行 python -m pip install --upgrade pip 升级pip模块

C:\Users\herion>python -m pip install --upgrade pip
Collecting pip
  Downloading pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 65 kB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
Successfully installed pip-20.2.4

检查升级

执行pip list,pip 模块已升级至20.2.4,警告已去除

C:\Users\herion>pip list
Package    Version
---------- -------
pip        20.2.4
setuptools 49.2.1

pip 安装模块

如下示例,在执行测试demo时提示没有 Flask模块

herion@herion-PC MINGW64 /d/python_wk/iJmeter/application (master)
$ python orderservice.py
Traceback (most recent call last):
  File "D:\python_wk\iJmeter\application\orderservice.py", line 5, in <module>
    from flask import Flask, request, make_response, jsonify, render_template
ModuleNotFoundError: No module named 'flask'

执行 pip install Flask 安装Flask

herion@herion-PC MINGW64 /d/python_wk/iJmeter/application (master)
$ pip install Flask
Collecting Flask
  Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Collecting Werkzeug>=0.15
  Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting itsdangerous>=0.24
  Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting click>=5.1
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting Jinja2>=2.10.1
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Using legacy 'setup.py install' for MarkupSafe, since package 'wheel' is not installed.
Installing collected packages: Werkzeug, itsdangerous, click, MarkupSafe, Jinja2, Flask
    Running setup.py install for MarkupSafe: started
    Running setup.py install for MarkupSafe: finished with status 'done'
Successfully installed Flask-1.1.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 itsdangerous-1.1.0
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页