Skip to content

DAVIDNYARKO123/pyenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Instructions to install specific Python versions on your Raspberry Pi

Note: Be sure your Raspberry Pi is up to date. To do so, run below command in terminal.

sudo apt-get update
sudo apt-get upgrade

Step1: Install pyenv:

Use the pyenv yet, you can do so using a package manager or by cloning the GitHub repository. Here, I'll provide instructions for using the installation script:

curl https://pyenv.run | bash

Step2: Add pyenv to shell configuration file(.bashrc):

echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
exec "$SHELL"

Step3: Install dependencies:

sudo apt-get install --yes libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libgdbm-dev lzma lzma-dev tcl-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev wget curl make build-essential openssl

On other systems, the dependencies might be different. Refer to the pyenv wiki for more information.

Step4: Install a specific Python version:

Use the pyenv install command to install the Python version you want. For example, to install Python 3.9.12:

pyenv install 3.9.12

Replace 3.9.12 with the version you want to install.

Step5: Set the global or local Python version:

After the installation is complete, you can set the global Python version or set it locally in a specific directory. For example, to set the global version:

pyenv global 3.9.12

To set the version locally in a specific directory, navigate to the directory and run:

pyenv local 3.9.12

Adjust the version number accordingly.

Step6: Verify the installation:

You can verify that the correct Python version is being used by running:

python --version

It should display the version you installed.

That's it! You have successfully installed a specific Python version using pyenv.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published