質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.51%
Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

Q&A

解決済

1回答

1075閲覧

ラズパイ python3.5.1 インストール エラー

shuppi

総合スコア47

Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

1グッド

0クリップ

投稿2017/09/08 01:32

編集2017/09/08 06:07

ラズパイでpython3.5.1を入れようとしたのですが、

Raspberry PiでのPython 3.5環境構築

Downloading Python-3.5.1.tar.xz... -> https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz Installing Python-3.5.1... ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? Please consult to the Wiki page to fix the problem. https://github.com/pyenv/pyenv/wiki/Common-build-problems BUILD FAILED (Raspbian 9.1 using python-build 1.1.3-26-g09bc868) Inspect or clean up the working tree at /tmp/python-build.20170907100758.2028 Results logged to /tmp/python-build.20170907100758.2028.log Last 10 log lines: (cd /home/pi/.pyenv/versions/3.5.1/share/man/man1; ln -s python3.5.1 python3.1) if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--upgrade" ;; \ install|*) ensurepip="" ;; \ esac; \ ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Ignoring ensurepip failure: pip 7.1.2 requires SSL/TLS

というエラーが出てできませんでした。

教えていただいたこのサイト(Ubuntu 15.10 で pyenv install 3.5.0 したら pip がインストールできなくて落ちる)で同じような事例があったので、入れようとしたライブラリがすでにあるようでした。

何が足りないのかわかりません。

教えてください。

~追記~
「dpkg -l libssl-dev」の結果は

$ sudo dpkg -l libssl-dev 要望=(U)不明/(I)インストール/(R)削除/(P)完全削除/(H)保持 | 状態=(N)無/(I)インストール済/(C)設定/(U)展開/(F)設定失敗/(H)半インストール/(W)トリガ待ち/(T)トリガ保留 |/ エラー?=(空欄)無/(R)要再インストール (状態,エラーの大文字=異常) ||/ 名前 バージョン アーキテクチャ 説明 +++-=====================-===============-===============-=============================================== ii libssl-dev:armhf 1.1.0f-3 armhf Secure Sockets Layer toolkit - development file
mt08👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

can110

2017/09/08 05:30

参考URLでの「Pythonのビルドに必要なものをインストール」と「pyenvのインストール」までは正常に行えたでしょうか?可能であれば各ログ(ターミナル表示結果)を追記ください。
shuppi

2017/09/08 05:35

「python3.5.1を突っ込みます」というところから出来ていません。「pyenv install 3.5.1」というコマンドで上記のエラーが出ました。
can110

2017/09/08 05:46

「sudo apt-get install build-essential ~libssl-dev ~」は正常に行えたということでしょうか?であれば「dpkg -l libssl-dev」の実行結果を追記ください。
can110

2017/09/08 05:54

またOSのバージョンも追記ください。(wheezy/Jessie/Stretch のどれか?)
shuppi

2017/09/08 06:07

「sudo apt-get install build-essential ~libssl-dev ~」は正常に行えていました。
shuppi

2017/09/08 06:08

OSのバージョンは「/etc/debian_version」で調べたら9.1でした。
can110

2017/09/08 06:14

追記ありがとうございます。libssl-devはインストールできており、バージョンは最新の「Stretch」ですね。参考URLは「Jessie」時代のものなので、手順を修正する必要があるのかもしれませんが、未調査です。
shuppi

2017/09/08 06:16

そこまで調べていただいて、ありがとうございます。
guest

回答1

0

ベストアンサー

shuppiさん、

Debian 9 Stretchでは、libssl-devは、OpenSSL 1.1.xベースになって、Pythonでのそのサポートがv3.5.3から、とのことで、エラーになるらしいです。

なので、Raspbian-stretchでは、sudo apt install libssl1.0-dev として、1.0ベースのをインストールすると、Python3.5.1がビルドできました。
ただし、libssl1.0-devと、libssl-dev(1.1.0)は、conflictしてて、同居できないので、どちらか一方を入れると、別のほうがなくなります。

pi@raspberrypi:~ $ sudo apt install libssl1.0-dev -y ... # libssl1.0-devを入れると、libssl-devが消える pi@raspberrypi:~ $ dpkg -l | grep libssl ii libssl-doc 1.1.0f-3 all Secure Sockets Layer toolkit - development documentation ii libssl1.0-dev:armhf 1.0.2l-2 armhf Secure Sockets Layer toolkit - development files ii libssl1.0.2:armhf 1.0.2l-2 armhf Secure Sockets Layer toolkit - shared libraries ii libssl1.1:armhf 1.1.0f-3 armhf Secure Sockets Layer toolkit - shared libraries pi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo apt install libssl-dev -y ... # libssl-devを入れると、libssl1.0-devが消える pi@raspberrypi:~ $ dpkg -l | grep libssl ii libssl-dev:armhf 1.1.0f-3 armhf Secure Sockets Layer toolkit - development files ii libssl-doc 1.1.0f-3 all Secure Sockets Layer toolkit - development documentation ii libssl1.0.2:armhf 1.0.2l-2 armhf Secure Sockets Layer toolkit - shared libraries ii libssl1.1:armhf 1.1.0f-3 armhf Secure Sockets Layer toolkit - shared libraries pi@raspberrypi:~ $
  • pyenv の準備
sudo apt update && sudo apt upgrade -y sudo apt-get install -y build-essential libncursesw5-dev libgdbm-dev libc6-dev zlib1g-dev libsqlite3-dev tk-dev libssl-dev openssl libbz2-dev libreadline-dev git clone https://github.com/pyenv/pyenv.git ~/.pyenv echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(pyenv init -)"' >> ~/.bash_profile source ~/.bash_profile # # libssl1.0-devに差し替える sudo apt install -y libssl1.0-dev libssl1.0.2
  • 実行例 : (2017-08-16-raspbian-stretch使用)
pi@raspberrypi:~ $ cat /etc/issue Raspbian GNU/Linux 9 \n \l pi@raspberrypi:~ $ cat /etc/debian_version 9.1 pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux pi@raspberrypi:~ $ pi@raspberrypi:~ $ pi@raspberrypi:~ $ time pyenv install 3.5.1 Downloading Python-3.5.1.tar.xz... -> https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz Installing Python-3.5.1... Installed Python-3.5.1 to /home/pi/.pyenv/versions/3.5.1 real 15m17.827s user 34m11.930s sys 1m47.100s pi@raspberrypi:~ $ pi@raspberrypi:~ $ pi@raspberrypi:~ $ python --version Python 2.7.13 pi@raspberrypi:~ $ python3 --version Python 3.5.3 pi@raspberrypi:~ $ pyenv local 3.5.1 pi@raspberrypi:~ $ pyenv versions system * 3.5.1 (set by /home/pi/.python-version) pi@raspberrypi:~ $ python --version Python 3.5.1 pi@raspberrypi:~ $ python3 --version Python 3.5.1 pi@raspberrypi:~ $ pyenv which python /home/pi/.pyenv/versions/3.5.1/bin/python pi@raspberrypi:~ $ pyenv which python3 /home/pi/.pyenv/versions/3.5.1/bin/python3 pi@raspberrypi:~ $ pyenv local system pi@raspberrypi:~ $ pyenv which python /usr/bin/python pi@raspberrypi:~ $ pyenv which python3 /usr/bin/python3 pi@raspberrypi:~ $

投稿2017/09/08 19:22

編集2017/09/08 19:55
mt08

総合スコア1825

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.51%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問