Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k views
in Technique[技术] by (71.8m points)

when i install python 3.9 on chromebook with linux penguin i still see the old version

I am not a linux user, so this might be a basic question.

I am trying to upgrade python version from 3.5 to 3.9 on a chromebook. The chrome book runs linux penguin (i type uname -a to get the version).

Linux penguin 5.4.67-09356-gf3ed4c0c4a31 #1 SMP PREEMPT Sun Sep 27 20:30:52 PDT 2020 aarch64 GNU/Linux

I have tried the following online method (replacing 3.7 for 3.9) but it fails: https://dev.to/serhatteker/how-to-upgrade-to-python-3-7-on-ubuntu-18-04-18-10-5hab

https://dev.to/serhatteker/how-to-upgrade-to-python-3-7-on-ubuntu-18-04-18-10-5hab

I have tried other online methods too, but they also fail so i now go back to the basics.

I have also tried this method for miniconda: https://docs.conda.io/en/latest/miniconda.html for both the 32 and 64 bit versions of python on linux but get the error message:

Miniconda3-latest-Linux-x86_64.sh: line 414: /opt/miniconda3/conda.exe: cannot execute binary file: Exec format error

In particular i note that the new python version is not in the /usr/bin folder, but the old version is.

I therefore do: sudo apt install python3.9 and see the following:

dlefcoe@penguin:~$ sudo apt install python3.9
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'postgresql-plpython3-9.6' for regex 'python3.9'
postgresql-plpython3-9.6 is already the newest version (9.6.20-0+deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.

This looks positive, but when i do python it still goes to the old version. When i type python3.9 the system returns:

-bash: python3.9: command not found

I presume that version 3.9 is installed somewhere (but where i don't know) or i have not installed it properly.

How can i get this working on the chromebook please ?

question from:https://stackoverflow.com/questions/65869567/when-i-install-python-3-9-on-chromebook-with-linux-penguin-i-still-see-the-old-v

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The following solution works:

  1. Install dependencies

    sudo apt update

    sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev

  2. Download latest release

    wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz

  3. extract file

    tar -xf Python-3.9.0.tgz

  4. configure script

    cd Python-3.9.0 ./configure --enable-optimizations

  5. build process

    make -j 12

  6. install binaries

    sudo make altinstall

And then test the version with python3.9 --version.

The full link is here: https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/

Presumably this will work with later versions too. So 3.9.x.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...