[chirp_users] Using Python 2 and Python 3 in Linux

D.J.J. Ring, Jr.
Mon May 18 11:54:08 PDT 2020


Various versions of Python can be used in Linux.

These instructions were for Slackware, but I suppose they work well in
other distributions.



Install pyenv as root:
1. cd /root
2. curl -L
https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer |
bash

update your .bashrc (or create it if not exists) and add this:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

load the new .bashrc with source .bashrc

now install the python version that you want like:

pyenv install 3.7.2 (you can have multiple versions installed at the same
time)
(you can check for the available versions with: pyenv install --list)

Switch to the new version with:

pyenv global 3.7.2 and run slpkg.
When you finish with it you can switch back to your original python with:

pyenv global system

And finaly check for the available python versions in your system with:

pyenv versions (the first 'system' means the python that is installed by
your system)

For example this is from mine:

root at lab:~#  pyenv versions
  system
  3.1.2
  3.5.5
* 3.7.2 (set by /root/.pyenv/version)

References: https://github.com/pyenv/pyenv

It seems that pyenv only reports the python versions installed into it.

My system python is: Python 2.7.17

73
David N1EA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_users/attachments/20200518/f9e6b951/attachment.html 


More information about the chirp_users mailing list