1. 程式人生 > >win10下pip升級報錯的解決辦法

win10下pip升級報錯的解決辦法

安裝tensorflow --gpu版時,提示我的pip有新版本9.0.3,打算直接更新。1.根據提示, 在cmd下執行
python -m pip install --upgrade pip
    時,提示:
Installing collected packages: pip   Found existing installation: pip 9.0.1     Uninstalling pip-9.0.1:...
解除安裝pip-9.0.1失敗。→然後通過管理員許可權開啟cmd再次執行
python -m pip install --upgrade pip
2.提示
D:\python\python.exe: No module named pip
還是不行→接著鍵入

D:\python362>python -m ensurepip

提示:
Requirement already satisfied: setuptools in d:\python362\lib\site-packages
Collecting pip
Installing collected packages: pip
Successfully installed pip-9.0.1

鍵入

D:\python>easy_install pip

提示:

Searching for pipBest match: pip 9.0.1Adding pip 9.0.1 to easy-install.pth fileInstalling pip-script.py script to d:\python\ScriptsInstalling pip.exe script to d:\python\ScriptsInstalling pip3-script.py script to d:\python\ScriptsInstalling pip3.exe script to d:\python\ScriptsInstalling pip3.5-script.py script to d:\python\ScriptsInstalling pip3.5.exe script to d:\python\ScriptsUsing d:\python\lib\site-packagesProcessing dependencies for pipFinished processing dependencies for pip

3.這時再輸入命令

python -m pip install --upgrade pip
最後成功安裝pip-9.0.3
Collecting pip
  Using cached pip-9.0.3-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3
以上借鑑網上眾多方法,經過嘗試,最終成功安裝,特此總結。當然期間還出現過找不到‘python’命令符的提示,通過新增PATH的方法解決了。第一次寫部落格,作為自己平時學習的小總結,也希望能幫助到遇到同樣問題的人。小白一隻,在寫部落格總結時,語言和方法可能都有或多或少的問題,希望各位批評指正,不吝賜教。我也會努力噠!