- 問題描述:
pip 安裝 tensorflow 時,出現異常提示,具體如下:
pip install tensorflow
出現如下錯誤提示(setuptools 版本太舊 , wrapt 不能卸載):
tensorboard 1.14.0 has requirement setuptools>=41.0.0, but you'll have setuptools 40.6.3 which is incompatible.
Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall
- 解決方法:
- 第一種,強制安裝,命令如下(推薦):
pip install --ignore-installed tensorflow
- 第二種,按照錯誤提示,一步步安裝(不推薦,麻煩):
更新 wrapt
>> pip install --ignore-installed wrapt
Collecting wrapt
Installing collected packages: wrapt
Successfully installed wrapt-1.11.2
更新 setuptools
>> pip install --ignore-installed setuptools
Installing collected packages: setuptools
Successfully installed setuptools-41.2.0
安裝 tensorflow, 這個時候就不出現錯誤提示了。
pip install tensorflow
pip list # 查看安裝好的 tensorflow
- 總結
當安裝過程出現異常提示時,需要強制安裝時,使用如下命令:
pip install --ignore-installed <庫名>