0
0

More than 1 year has passed since last update.

pythonのpyenvでBUILD FAILD

Posted at

環境

windows10 20H2 19042 1466
Linux(Devian)

該当エラー

(ユーザー名)@XXX:~$ pyenv install 3.10.2
Downloading Python-3.10.2.tar.xz...
-> https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tar.xz
Installing Python-3.10.2...
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 (Debian GNU/Linux 9 using python-build 2.2.4-1-4-g1e79a522)

Inspect or clean up the working tree at /tmp/python-build.20220207141603.8256
Results logged to /tmp/python-build.20220207141603.8256.log

///以下略

試行錯誤

とりあえずまずは普通にインストールしてみたら、上記のようなBUILD FAILED エラーが出る。
なので別のバージョンで確認してみた。

(ユーザー名)@XXX:~$ pyenv install 3.6.2
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
Installing Python-3.6.2...
Installed Python-3.6.2 to /home/testuser/.pyenv/versions/3.6.2

最新の3.10.X系以上ではだめだったけど、それ以下のバージョンはインストールできました。

何とか最新バージョンを入れることはできないか確とググってみると、下のようなサイトを発見。

参考サイト参考サイト参考サイト

解決策

まず、terminalでPATHの設定と再起動をやってみます。

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
exec $SHELL -l

実行した後[プロセスが完了しました]と表示さえれば処理はちゃんと適用しました。

pyenv versionで確認してみると

(.venv) XXX@XXX:~/project1$ pyenv versions
  system
  3.8.2
  3.6.2 //ちゃんと入ってる

最新バージョンはなぜか入らない・・・

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