Saturday, February 24, 2024

Setup Python 3.12.2 on SparkyLinux2024.2 (kernel 6.7.6) via pyenv

UPDATE as of 02/25/24

To install Python 3.12.2 on ManjaroKDE 23.1.3 Stable branch :
[boris@boris-manjaro ~]$ sudo pacman -S base-devel tk git
To obtain the most recent state of pyenv clone the external git repo rather then install -  $ sudo pacman -S pyenv
[boris@boris-manjaro ~]$  git clone  https://github.com/pyenv/pyenv.git ~/.pyenv
Cloning into '/home/boris/.pyenv'...
remote: Enumerating objects: 23830, done.
remote: Counting objects: 100% (2341/2341), done.
remote: Compressing objects: 100% (369/369), done.
remote: Total 23830 (delta 2051), reused 2144 (delta 1932), pack-reused 21489
Receiving objects: 100% (23830/23830), 4.76 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (16165/16165), done.
[boris@boris-manjaro ~]$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
[boris@boris-manjaro ~]$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >>  ~/.zshrc
[boris@boris-manjaro ~]$ echo 'eval "$(pyenv init --path)"' >> ~/.zshrc
[boris@boris-manjaro ~]$ source ~/.zshrc
[boris@boris-manjaro ~]$ pyenv --version                                           pyenv 2.3.36-3-gf9a2bb81
[boris@boris-manjaro ~]$ pyenv install --list | grep 3.12.2  
                 3.12.2
[boris@boris-manjaro ~] $ pyenv install  3.12.2                                  Downloading Python-3.12.2.tar.xz...
-> https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tar.xz
Installing Python-3.12.2...
Installed Python-3.12.2 to /home/boris/.pyenv/versions/3.12.2
[boris@boris-manjaro ~] pyenv global  3.12.2



END UPDATE

This post is an immediate follow up on previous one   http://lxer.com/module/newswire/view/337189/index.html   to perform install Python 3.12.2 for particular user via pyenv  in the same way as it was done in the link above.  Then create new project in PyCharm with path to interpreter /home/boris/.pyenv/versions/3.12.2/bin/python3

boris@boris-sparky2024:~$ hostnamectl
Static hostname: boris-sparky2024
      Icon name: computer-vm
        Chassis: vm
     Machine ID: 17b78005aa0441f0b8495db7ea04cb19
        Boot ID: c5eafe586eab44ed90e78e1aeb4ea270
 Virtualization: kvm
Operating System: SparkyLinux 8 (Seven-Sisters)    
         Kernel: Linux 6.7.6-sparky8-amd64
   Architecture: x86-64
Hardware Vendor: QEMU
 Hardware Model: Standard PC _Q35 + ICH9, 2009_
Firmware Version: 1.16.3-1.fc39
  Firmware Date: Tue 2014-04-01
   Firmware Age: 9y 10month 3w 3d   

boris@boris-sparky2024:~$ sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git

boris@boris-sparky2024:~$ git clone  https://github.com/pyenv/pyenv.git ~/.pyenv

Cloning into '/home/boris/.pyenv'...

remote: Enumerating objects: 23800, done.

remote: Counting objects: 100% (2311/2311), done.

remote: Compressing objects: 100% (349/349), done.

remote: Total 23800 (delta 2036), reused 2128 (delta 1925), pack-reused 21489

Receiving objects: 100% (23800/23800), 4.75 MiB | 4.74 MiB/s, done.

Resolving deltas: 100% (16150/16150), done.

boris@boris-sparky2024:~$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc

boris@boris-sparky2024:~$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc

boris@boris-sparky2024:~$ echo 'eval "$(pyenv init --path)"' >> ~/.bashrc

boris@boris-sparky2024:~$ source ~/.bashrc   

boris@boris-sparky2024:~$ pyenv install 3.12.2          
boris@boris-sparky2024:~$ pyenv global 3.12.2
boris@boris-sparky2024:~$ python3.12
Python 3.12.2 (main, Feb 24 2024, 13:19:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle as trt
>>>











No comments:

Post a Comment