<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          pip 不能用了怎么辦

          共 1871字,需瀏覽 4分鐘

           ·

          2021-08-04 17:13


          須彌零一

          背景

          今天在使用 pip install pip -U 命令升級 pip 時沒太注意。執(zhí)行完之后界面好像報了一個錯誤,當時沒在意。結果在安裝 mysql 驅動的時候發(fā)現報錯了。報錯信息如下:

          Traceback (most recent call last):  File "e:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main    return _run_code(code, main_globals, None,  File "e:\program files\python39\lib\runpy.py", line 87, in _run_code    exec(code, run_globals)  File "E:\Program Files\Python39\Scripts\pip.exe\__main__.py", line 4, in <module>ModuleNotFoundError: No module named 'pip'

          上面的提示信息很明顯。就是因為 pip 升級沒成功,導致舊版本刪除了,新版本沒裝上。pip 就這么沒了。

          解決

          這個問題也好解決,分別執(zhí)行如下兩條命令即可:

          python -m ensurepippython -m pip install --upgrade pip

          執(zhí)行過程和結果如下:

          C:\Users\jerem>python -m ensurepipLooking in links: c:\Users\jerem\AppData\Local\Temp\tmphxj9e51_Requirement already satisfied: setuptools in e:\program files\python39\lib\site-packages (49.2.1)Processing c:\users\jerem\appdata\local\temp\tmphxj9e51_\pip-20.2.3-py2.py3-none-any.whlInstalling collected packages: pipSuccessfully installed pip-20.2.3C:\Users\jerem>python -m pip install --upgrade pipLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simpleCollecting pip  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7c/02/9ab8b431aca1b46fcc1ac830a5870a28a12ba1abfa681904b1d2da876a86/pip-21.2.1-py3-none-any.whl (1.6 MB)Installing collected packages: pip  Attempting uninstall: pip    Found existing installation: pip 20.2.3    Uninstalling pip-20.2.3:      Successfully uninstalled pip-20.2.3Successfully installed pip-21.2.1

          通過以上回顯可以看出我們已經修復成功了。

          驗證

          使用如下命令驗證即可:

          pip -V

          注意:上面的參數是大寫的 V

          命令回顯如下,即可證明安裝OK。

          C:\Users\jerem>pip -Vpip 21.2.1 from e:\program files\python39\lib\site-packages\pip (python 3.9)

          原文:https://www.jeremysong.cn/cn/pip-can-not-used/

          ---- END ----



          歡迎關注我的公眾號“須彌零一”,更多技術文章第一時間推送。

          瀏覽 134
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  搞bim视频免费网站 | 色逼逼操逼 | 欧美日韩在线观看123 | 九九色网址| 91影院体验区 |