10

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?

zest16
  • 455
  • 3
  • 7
  • 20

3 Answers3

13

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

edilio
  • 1,778
  • 14
  • 13
  • 1
    In order to run `pyenv update`, you first need to install this plugin: https://github.com/pyenv/pyenv-update After that, you should 3.10.5 when you run `pyenv install --list` – David Lasry Aug 14 '22 at 07:32
7

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
crifan
  • 12,947
  • 1
  • 71
  • 56
0

I don't think that's possible. Running pyenv install -list will give you a list of all possible python versions that can be installed, and it will only go as far as 3.10.4 as of this writing.

AlphaCR
  • 806
  • 2
  • 9
  • 23
  • Nah, @Swakeert Jain really helped me, now I've got Python 3.10.5 on my computer: `bscuser@localhost:/run/media/bscuser/6C19-3138/Thesis/Corpus/Softcatala> python3 Python 3.10.5 (main, Jun 15 2022, 10:33:16) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ` – zest16 Jun 23 '22 at 06:54
  • @zest16 how did u manage? with `pyenv install -list` I can only see up until 3.10.4 – TLListenreich Jun 29 '22 at 07:05
  • I restarted the shell as @Swakeert Jain suggested. – zest16 Jun 30 '22 at 09:10