zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Multiple python versions with pyenv

March 11, 2019 by Igor Drobot Leave a Comment

Perhaps you have have a bunch of staging or testing systems with different python version and you have to switch between different systems to test your written code with different python version.
Or you tried to use multiple python version parallel installed, lets say on a older os.
That a really mess!

pyenv lets you easily switch between multiple versions of Python.
In each project directory can be used a different python version, which has no conflicts with the global installation.

Install pyenv with required dependencies:

zypper install --type pattern devel_basis 
zypper in pyenv openssl-devel readline-devel

Add to ~/.bash_profile , or ~/.bashr depending on your shell or operating system:

eval "$(pyenv init -)"

Lets, say you have a project directory project_on_3.5,
which contains a code which is only runable with python 3.5.6:

mkdir project_on_3.5 && cd project_on_3.5
pyenv install 3.5.6
pyenv local 3.5.6
python -V
Python 3.5.6

With pyenv, you can have unlimited python version on a single system instance.

Filed Under: Linux

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok