Help us understand the problem. What is going on with this article?

pip version 10.0.0でImportError: cannot import name mainが発生する場合の対処法

More than 1 year has passed since last update.

この記事について

pip 10.0.0.0を実行した際に、下記エラーが発生する場合の対処法を記載します。

$pip install hoge
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main

対処法

/usr/bin/pipを下記の通り修正します。

修正前

from pip import main
if __name__ == '__main__':
    sys.exit(main())

修正後 (3箇所)

from pip import __main__
if __name__ == '__main__':
    sys.exit(__main__._main())
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away