[Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19
boB Stepp
robertvstepp at gmail.com
Sun Jul 15 19:38:32 EDT 2018
On Sat, Jul 14, 2018 at 8:23 PM Mats Wichmann <mats at wichmann.us> wrote:
>
> take a look at pyenv. should make it fairly easy.
>
> https://github.com/pyenv/pyenv
I just completed getting access to Python 3.6.6 using pyenv, so I
guess I'll post my experience for future searchers. It was not
totally painless, and I am still pondering whether I used "sudo"
inappropriately or not. Recall I am on Linux Mint 19 Cinnamon
edition.
First, the page Mats linked to mentioned an automatic installer for
pyenv in another GitHub project of the author's, so I used that. It
was here: https://github.com/pyenv/pyenv-installer
I used the recommended "GitHub way" instead of the PyPi way which
apparently is still in development and doesn't work for Python 3
anyway. So I ran:
$ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer
| bash
Then I added to the end of my .bashrc:
export PATH="/home/bob/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
This apparently allows pyenv's "shims" to take precedence in the
search path for Python versions. Warning: On the page Mats linked
there are some reports of getting into an infinite search loop if
these lines are added to .bashrc. After pondering the specifics I did
not think it would affect me, so I went ahead with what I did.
I then did the suggested restart of my shell with:
$ exec "$SHELL"
pyenv seemed to be successfully installed. I ran
$ pyenv update
just to be sure I had the latest, greatest, which I did. I then ran
$pyenv install --list
to see if Python 3.6.6 was available. It was and the list of
available versions is HUGE running from 2.1.3 to 3.8-dev to Active
Python versions to Anaconda versions, IronPython, Jython, MiniConda,
PyPy, Stackless, etc. So I thought I was ready to download and
install Python 3.6.6 with
$ pyenv install 3.6.6
It *did* download from
https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz, something
you could tell I was concerned about from my earlier posts.
Unfortunately I got:
Installing Python-3.6.6...
BUILD FAILED (LinuxMint 19 using python-build 20180424)
So I went to https://github.com/pyenv/pyenv/wiki/Common-build-problems,
which at the very top of the page recommended running this:
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev
So without pausing for further thought I did run it, but now wonder if
this will cause me future consequences with system stuff as later I
read on the FAQ page a similar command without granting sudo
privileges. So I jumped into the fire on this one without fully
understanding what I was doing.
But after doing this I was able to get 3.6.6, but there was still one
more thing to do and that was to run
$ pyenv global 3.6.6
because I did want to be able to type python3 in the shell and get
specifically 3.6.6 as my default version -- for now at least.
I probably did not do everything like I should, but maybe this will
help someone down the line do better. So far I seem to have
everything working and doing what I had hoped for. pyenv looks like a
fine tool for managing as many Python versions as one wants to play
around with, and does seem to support virtual environments with a
plugin.
boB
More information about the Tutor
mailing list