Raspberry Pi python pipのSSLエラー

お絵かき 技術 Linux

ラズパイに最新のpython3.7系入れてpip使おうとしたらSSLでエラーが出て失敗。

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pip in /usr/local/lib/python3.7/site-packages (18.1)
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

ぐぐったらまさかの自分の記事が先頭に出てきて、成長の無さに悲しくなる。

www.unknownengineer.net

ラズパイだと、openssl-devel無いので対応した内容をメモっときます。

openssl-develは無い

$ sudo apt-get install openssl-devel
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
E: パッケージ openssl-devel が見つかりません

無い。終了!ではなく、Debian系だと入れるものが異なります。

libssl-devを入れる

以下実施します。

$ sudo apt-get install libssl-dev

これを入れ直してから、再度python3.7をmake/make altinstallし直します。make結構時間かかるので、なるべく事前に入れておきましょう。

# pip3.7 install --upgrade pip
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pip
Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 3.4MB/s
Installing collected packages: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Successfully installed pip-19.0.3

はっぴー!

【プロフィール】

【無音鈴鹿】
お絵かきが好きなエンジニアの成れの果て

Twitter


【広告】