升級 pip 後出錯:無法導入名稱“main” - Error after upgrading pip: cannot import name 'main'

問題:

Whenever I am trying to install any package using pip, I am getting this import error:每當我嘗試使用 pip 安裝任何軟件包時,都會收到此導入錯誤:

guru@guru-notebook:~$ pip3 install numpy
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'


guru@guru-notebook:~$ cat `which pip3`
#!/usr/bin/python3
# GENERATED BY DEBIAN

import sys

# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import main
if __name__ == '__main__':
    sys.exit(main())

It was working fine earlier, I am not sure why it is throwing this error.早些時候它工作正常,我不知道爲什麼會拋出這個錯誤。 I have searched about this error, but can't find anything to fix it.我已經搜索過這個錯誤,但找不到任何可以修復它的東西。

Please let me know if you need any further detail, I will update my question.如果您需要更多詳細信息,請告訴我,我會更新我的問題。


解決方案:

參考一: https://stackoom.com/question/3N6nM
參考二: Error after upgrading pip: cannot import name 'main'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章