升级后的点子错误

时间:2018-10-23 23:08:07

标签: pip importerror traceback

升级到pip 18.1后,每当我尝试对pip做任何操作时,都会出现此导入错误:

Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\pip.exe\__main__.py", line 5, in <module>
ImportError: cannot import name 'main' from 'pip' (C:\Users\asbwi\AppData\Roaming\Python\Python37\site-packages\pip\__init__.py)

1 个答案:

答案 0 :(得分:1)

  1. pip3 install --upgrade pip setuptools --user

    This should solve your issue with pip
    
                     or
    
  2. python -m pip install --upgrade pip == 9.0.3 [这将降低pip版本]

    Check the pip version using "**pip --version**"