Error after upgrading pip: cannot import name 'main'

后端 未结 30 2081
清歌不尽
清歌不尽 2020-11-22 15:51

Whenever I am trying to install any package using pip, I am getting this import error:

guru@guru-notebook:~$ pip3 install numpy
Traceback (most recent call l         


        
30条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 16:31

    Is something wrong with the packages, when it generating de file /usr/bin/pip, you have to change the import:

    from pip import main
    

    to

    from pip._internal import main
    

    That solves the problem, I'm not sure why it generated, but it saids somthing in the following issue:

    After pip 10 upgrade on pyenv "ImportError: cannot import name 'main'"

提交回复
热议问题