Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Python 3.10.5 using pyenv

I want to install Python 3.10.5 (or at least Python >= 3.7.). I followed these instructions:

# Step 1. Install pyenv

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bashrc

# Step 2. Install missing headers for all the Python modules to be built

sudo zypper install readline-devel sqlite3-devel libbz2-devel

# Step 3. Install the desired Python version

pyenv install 3.10.5

until I got to pyenv install 3.10.5:

bscuser@localhost:~> pyenv install 3.10.5
/home/bscuser/.pyenv/plugins/python-build/share/python-build/3.7.13: line 1: prefer_openssl11: command not found

BUILD FAILED (openSUSE 15.3 using python-build 20180424)

I feel like it should be related to this file.

How do I solve this?

like image 977
zest16 Avatar asked Feb 19 '26 19:02

zest16


2 Answers

Yes, you can. Use pyenv update first then running pyenv install -list you should be able to see versions 3.10.4, 3.10.5, 3.10.6, 3.11.0, even 3.11.1 now

like image 154
edilio Avatar answered Feb 21 '26 08:02

edilio


here is similar case:

OS: macOS, previously installed old version pyenv 1.2.26

-> pyenv install -l see the latest python version is 3.10-dev, not expected 3.10.x

so need upgrade pyenv to latest version, here pyenv 2.3.3:

  • on macOS: brew upgrade pyenv
    • you can refer official doc to install/upgrade to latest pyenv

then can list to latest python 3.10.5+:

> pyenv install --list | grep 3.10
...
  3.10.0
  3.10-dev
  3.10.1
  3.10.2
  3.10.3
  3.10.4
  3.10.5
  3.10.6
  mambaforge-4.10.3-10
  miniconda-3.10.1
...

then can use pyenv install 3.10.6 normally:

pyenv install 3.10.6

so, here key point is:

  • upgrade pyenv to latest version (here pyenv 2.3.3), then pyenv install --list can list/see latest python and install it pyenv install 3.10.6
like image 29
crifan Avatar answered Feb 21 '26 09:02

crifan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!