相談内容
pythonの勉強を始めたばかりの大学3年生です。
Pythonのpip3を使ってモジュールをインストールしたいのですが使えなくて困っています。
とりあえずpip3でモジュールをインストールできる状態にしたいです。
例えば、「pip install virtualenv」 とMacのターミナルに入力すると下記のようなエラーが出力されました。
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Requirement already satisfied: virtualenv in ./.pyenv/versions/3.7.3/lib/python3.7/site-packages (16.7.7) WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
他のモジュールをインストールしようとしても同じようなエラーが出力されてしまいます。
エラー文を見ると 標準搭載のSSLモジュールが無効になっているようで、1番の原因はこれだと思ったので、「Python3」でインタラクティブシェルを開き「import ssl」を入力すると、案の定以下のエラー文が出力されました。
>>> import ssl Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/hw17a027/.pyenv/versions/3.7.3/lib/python3.7/ssl.py", line 98, in <module> import _ssl # if we can't import it, let the error propagate ImportError: dlopen(/Users/hw17a027/.pyenv/versions/3.7.3/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /Users/hw17a027/.pyenv/versions/3.7.3/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so Reason: image not found
原因が分かる方いらっしゃいましたら、よろしくお願いいたします。(^^;)
以下に詳細な情報を付け足しておきます。
補足情報
・試したこと
Macの再起動
brewやpipのアップデート
pipの再インストール
OpenSSLの再インストール
・各ツールバージョン
macのバーション: Mojave 10.14.6
pythonのバージョン: 3.7.3 (保存先: /Users/ユーザー名/.pyenv/shims/python)
pipのバージョン: 19.3.1 (保存先: /Users/ユーザー名/.pyenv/shims/pip)
回答2件
あなたの回答
tips
プレビュー