8
9

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を使おうとして「TypeError: 'module' object is not callable」が出た場合の対処方法メモ

8
Last updated at Posted at 2019-10-28

正確な発動条件が定かではないですが、ubuntu18.04にpipを手動インストールし、pyenvで環境構築した際にタイトルのエラーが発生したので、解決できた方法をメモします。

現象

上記条件で、pyenvで作成したpython環境でpipを実行しようとすると次のエラーが出て動かない。

>> pip
Traceback (most recent call last):
  File "/home/dev-user/.pyenv/versions/3.6.7/bin/pip", line 11, in <module>
    sys.exit(main())
TypeError: 'module' object is not callable

解決方法

pyenv環境で次のコマンドでpipインストールを再実行したところ解決。

curl -kL https://bootstrap.pypa.io/get-pip.py | python

あとがき

エラーメッセージで検索すると、aptでpipをアップデートしている記事や、pip install pip==18.0などでversionを戻している記事などはあったのですが、直接的な解法にたどり着くのに時間がかかったのでメモを兼ねて記事にしました。

8
9
1

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
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?