1
1

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 installでssl module in python is not availableとエラーがでた

Last updated at Posted at 2020-05-27

またダメになった(2020/5/29追記)

vscodeのsetting.jsonファイルを編集してたらpipの中からdjangoが消え、pip install djangoをしても下記のようにsslが使えないと怒られました。
調べたら、pythonのバージョンをあげるだけで治った人がいるらしい。
pip install でSSL関連のエラーが出たらこれを読め!!!
自分もこれで直りました!!!!!!
具体的には、python3.7.3 -> 3.8.2に変更しました。

こういうのはなんでダメでなんで治ったのかよくわからないから困りますよね。

始まり

pip install DjangoとDjangoをダウンロードしようとしたら、ssl module in python is not availableと怒られた。

やったこと

pip installでSSLのエラーを参考に頑張る。
自分がやったことは


export PATH="/usr/local/opt/openssl/bin:$PATH"

のパスを.bash_profileに書くこと。
他はなんとかなっていたのだが、最後のpip install Djangoでエラー。

エラー内容はあんまり覚えてないが、確か「 LoadError: dlopen(〜): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib」と表示された場合の解決法と同じエラー。
このサイトに習い、

brew update && brew upgrade

を行い更新をかける。
結果として、ターミナルでpythonと打ってもpythonが実行されなった。

Homebrewをアップデートしたらpythonが死んだを見つけ


export PATH=/usr/local/opt/python/libexec/bin:$PATH

を.bash_profileに追加する。
find ~/usr/local/** -name python(間違えました 2020/5/28追記)find /usr/local/** -name pythonで確認し、/usr/local/opt/python/libexec/bin/pythonの結果が返ってこなかったが、自分はターミナル上でpythonと打つとpythonが実行されるようになった。

最終的にpip install Djangoで無事Djangoがインストールできました。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?