Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Python 3.5 on Jessie

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
wheeler
Posts: 2
Joined: 2015-11-25 03:25

Python 3.5 on Jessie

#1 Post by wheeler »

Hello,
I am really keen to start working with Python 3.5 primarily because of matrix multiplication operator, as much of my work involves matrices.
Jessie contains Python 2.7 and 3.4. I need to keep Python 2.7 on my system for my Python2 code.

As a new user of Jessie (previously used Ubuntu 12.01 and Windows), I don't know what is the best way of installing Python 3.5, without corrupting existing Python 2.7 or Python 3.4 shipped with Debian 8.
Perhaps, I am overly cautious, but I need your expert opinion on how to do this, as this is the first time I am dealing with two different versions of Python distribution on one system other than Windows.

What is the best way of installing Python 3.5 without overwriting any Python 3.4 or Python 2.7 dependencies by accident?

Googling the problem, the solution is:

1. Build Python 3.5 from sources.
- by using ./configure, make etc.. as per https://hg.python.org/cpython/file/3.5/README
Question: If I was to build Python 3.5 and subsequently install numpy and scipy libraries, will they correctly link to Python 3.5 or do they install to Python 3.4?
(Perhaps this question is better suited for Python forum rather than here but I will gladly take any input)
Once I build from sources, how do I update Python 3.5 if there are any updates? Do I rebuild from source?

2. As per this post use Ubuntu PPA.
http://unix.stackexchange.com/questions ... -on-debian
- I am not comfortable with using Ubuntu PPA just because I do not know enough about differences between Debian and Ubuntu to know how this could break my OS or existing Python installations.
Though this seems the easiest way.
Can someone weigh in on this option?

3. Use Debian Experimental:
- I cannot locate the site I saw this on. Seems I've lost the link.
Should I consider this option?
I would follow the steps shown on http://stackoverflow.com/questions/1724 ... -on-debian except use Python 3.5 as per this package:
https://packages.debian.org/experimental/python3

-Will updating of my system also update Python 3.5?

Thank you in advance.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Python 3.5 on Jessie

#2 Post by GarryRicketson »

I wouldn't follow that one on "stackoverflow", they are giving very bad advise, and it is a post that was made in 2013, ;
But, that aside, the OP says they are using 'Wheezy", and the idiot that answers tells them to use a 'experimental" source,
I have wheezy debian
answer;
Add
deb http://ftp.debian.org/debian experimental main contrib non-free
to your /etc/apt/sources.list or into /etc/apt/sources.list.d/experimental.list then execute apt-get update
apt-get -t experimental install deluge
This is just plain bad advise, to suggest to someone to mix Debian experimenatl, with a stable version.
I think you should read this, to start with:
https://wiki.debian.org/DontBreakDebian
Same on this :
by wheeler »
2. As per this post use Ubuntu PPA.
http://unix.stackexchange.com/questions ... -on-debian
- I am not comfortable with using Ubuntu PPA just because I do not know enough about differences between Debian and Ubuntu to know how this could break my OS or existing Python installations.
Though this seems the easiest way.
Below is what the idiot at "stackexchange" says,...
You can use the PPA on Debian. Pick an Ubuntu version that's from slightly before your Debian version, and it should have all the necessary libraries. For wheezy, the oneiric PPA seems ok (but it lacks more recent Python versions). For jessie, the trusty PPA should work.
Ubuntu , is not Debian, and mixing the stuff intended for Ubuntu with Debian is a VERY bad idea. But thanks for sharing these, now we know where some people are getting all these weird ideas, and then coming here asking for help to fix their "broken" toy's.
Take a look at this, if you don't believe me:
From: http://forums.debian.net/viewtopic.php?f=20&t=114130
The smartest folks ask first, something along the lines of, "Can I mix Debian Stable with <something else>?"
Answer: This is a very risky thing to attempt, and is generally regarded as a bad idea for all but the most advanced Debian users.
So at least, you are being smart in asking here first,
I hope you do not do anything until you get some better answers, here.
You could upgrade to Debian "experimental", if you must have the "shiniest newest" version of python. However you need to be sure to upgrade correctly, and also COMPLETELY, understand the risks, and problems involved in using a "experimental" version of Debian are. Read the documentation and manuals from the Debian wiki , and sources and follow them, and also what others may offer here.
Stay away from these "clowns" that don't have a clue as to what they are talking about, on "stackexchange" and other "kiddie blogs".
-Will updating of my system also update Python 3.5?
I don't know on that,...
I am no where near "advanced" enough try to help tell you how to upgrade or update, to experimental, etc. and I don't think it is a good idea, but there are others here that may be able to explain the best way to accomplish what you want, if it is even possible.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Python 3.5 on Jessie

#3 Post by stevepusser »

The PPA may or may not work. The surest way to get compatible packages is to rebuild them from the source in the PPA on your system.
MX Linux packager and developer

wheeler
Posts: 2
Joined: 2015-11-25 03:25

Re: Python 3.5 on Jessie

#4 Post by wheeler »

Thank you Garry and Steve for such a great advice.

Thank you Garry for your candidness and highlighting these links:
https://wiki.debian.org/DontBreakDebian
http://forums.debian.net/viewtopic.php?f=20&t=114130

I will not use Ubuntu PPAs or Experimental/Testing. Instead, I will continue working in Python 3.4 and Python 2.7 for two years or so longer.
My whole intention of using Debian is to have the system that just works without new software mucking things up.

The compiling of sources in .local and using checkinstall will be the way I will go with when the time comes for Python upgrade or perhaps run a VirtualBox session to prevent damaging Debian.

freshdogofbelair
Posts: 10
Joined: 2015-11-20 18:46

Re: Python 3.5 on Jessie

#5 Post by freshdogofbelair »

I switch between python versions all the time. On any OS, be it Linux or OSX, I always use pyenv. https://github.com/yyuu/pyenv . I'm not sure if the 3.5 binary is available yet but when it is, I'll be installing it through this tool. Leave python system installations alone.

fred barclay
Posts: 124
Joined: 2015-01-24 03:10

Re: Python 3.5 on Jessie

#6 Post by fred barclay »

You might also consider creating a Debian Sid virtual machine so you can use python 3.5 (though you'd probably still have to add the Debian experimental repos).

That way, you still get Python 3.5, and if something breaks, it's all contained in a vm and your real system isn't harmed in the least.

branau
Posts: 5
Joined: 2016-05-20 11:15
Location: Puebla, Mexico

Re: Python 3.5 on Jessie

#7 Post by branau »

freshdogofbelair wrote:I switch between python versions all the time. On any OS, be it Linux or OSX, I always use pyenv. https://github.com/yyuu/pyenv . I'm not sure if the 3.5 binary is available yet but when it is, I'll be installing it through this tool. Leave python system installations alone.
I agree with this. I'm a big fan of pyenv, and also highly recommend it. +1 on leaving the system's Python alone

Post Reply