The officially official Devuan Forum!

You are not logged in.

#1 2017-11-14 20:14:11

shirase
Member
Registered: 2017-11-14
Posts: 3

How to install the latest python?

How can I install the latest python?  My current version is Python 2.7.9 and I'd like to install python3.5 or the latest version.

Offline

#2 2017-11-14 20:42:40

golinux
Administrator
Registered: 2016-11-25
Posts: 654

Re: How to install the latest python?

Have you looked in devuan backports?

Offline

#3 2017-11-14 21:01:15

shirase
Member
Registered: 2017-11-14
Posts: 3

Re: How to install the latest python?

golinux wrote:

Have you looked in devuan backports?

I'm a beginner so bare with me, am I doing this right? I added this to my /etc/apt/sources.list
# /etc/apt/sources.list.d/devuan-stable-backports.list

deb     http://auto.mirror.devuan.org/merged jessie-backports main
deb-src http://auto.mirror.devuan.org/merged jessie-backports main

ran apt-get update and apt-get install python3.6 and this is what it gave back to me.
https://pastebin.com/SrXYanqE
(I haven't typed yes or no yet I don't want to do anything that can break my system)

Offline

#4 2017-11-14 21:12:22

fsmithred
Administrator
Registered: 2016-11-25
Posts: 444

Re: How to install the latest python?

NO!  Don't do it. (Not sure exactly what the package manager is trying to do there, but it looks bad.)

There's no python3.5 in jessie or jessie backports. You can get 3.4 from the regular jessie repo.

apt-get install python3

Comment out the backports lines and run 'apt-get update' again. Then install python3. If you did a full desktop install, you probably already have it.

If you want to see a list of all the python packages that are installed, run

dpkg -l | grep python

Offline

#5 2017-11-14 21:19:57

shirase
Member
Registered: 2017-11-14
Posts: 3

Re: How to install the latest python?

fsmithred wrote:

NO!  Don't do it. (Not sure exactly what the package manager is trying to do there, but it looks bad.)

There's no python3.5 in jessie or jessie backports. You can get 3.4 from the regular jessie repo.

apt-get install python3

Comment out the backports lines and run 'apt-get update' again. Then install python3. If you did a full desktop install, you probably already have it.

If you want to see a list of all the python packages that are installed, run

dpkg -l | grep python

I did what you said and I do have python3.4 already installed. Thanks for your help.
Is there a way I can set this python version as default? When I run python --version it says Python 2.7.9

Last edited by shirase (2017-11-14 21:20:28)

Offline

#6 2017-11-14 21:33:20

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 117

Re: How to install the latest python?

By the looks of it, "python" doesn't make use of the "alternatives" set up, but have /usr/bin/python as a link (to python2.7). You might change that but that could have severe ramifications, because there are more than a few system programs using python, and these may well expect and/or utilize python2.7.

A safer way could be to patch it only for yourself (and not root), e.g., by having $HOME/bin early in your $PATH, and make $HOME/bin/python a link to /usr/bin/python3. That will be an override for the user but not for root.

Offline

#7 2017-11-14 22:56:33

greenjeans
Member
Registered: 2017-04-07
Posts: 356
Website

Re: How to install the latest python?

ralph.ronnquist wrote:

By the looks of it, "python" doesn't make use of the "alternatives" set up, but have /usr/bin/python as a link (to python2.7). You might change that but that could have severe ramifications, because there are more than a few system programs using python, and these may well expect and/or utilize python2.7.

The above part I bolded is 100% true.

Shirase: before it's over with you'll probably have 3 versions of Python. An easy way to test if something is needed is to try and uninstall it in Synaptic, if you get a huge list of stuff it wants to uninstall with it then you know for sure.


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal 64 and 32 bit Devuan-based openbox and mate systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#8 2017-11-15 18:07:40

ilargi
Member
Registered: 2017-06-23
Posts: 1

Re: How to install the latest python?

First time poster here.
Not sure if this is what you're looking for but I just add this alias to my regular user's .bashrc

alias python='/usr/bin/python3.4'

Any python scripts I run from a console will then use python3.4

Offline

Board footer