42
30

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Last updated at Posted at 2018-05-22

この記事について

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())
42
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
30

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?