LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-28-2012, 02:47 PM   #1
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Rep: Reputation: 0
Python 2 and 3 install


How can I get python 3 installed but without ruining my python 2 scripts that come with Slackware if any or are used in any of my programs I've added. I don't think there are any but I can't be the one to say that cause likely there is. I just I want to use python 3 but the system has python 2 so how can I install both without ruining either isntallation?
 
Old 12-28-2012, 02:54 PM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,407

Rep: Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853
use the python3 slackbuild from slackbuilds.org

http://slackbuilds.org/repository/14.0/python/python3/

it's safely parallel installable with the stock python of slackware: the interpreter will be called python3 so it won't conflict with python (the one of the 2.7.x version).

be aware that python-2.7.x and python-3.3.x have different folders where they store their modules, /usr/lib$LIBDIRSUFFIX/python2.7 and /usr/lib$LIBDIRSUFFIX/python3.3: if you, by any chance, will install any third party module, it will be built/installed/available only for one of the two versions of pyhton, most probably the 2.7.x one as /usr/bin/python will be found...

Last edited by ponce; 12-28-2012 at 03:01 PM.
 
2 members found this post helpful.
Old 12-28-2012, 03:39 PM   #3
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Original Poster
Rep: Reputation: 0
Thank you didn't know that but now I have the question of if I install pygame which I might I'm not sure it's unlikely but say I do. How could I get it installed for python3? other then that great job
 
Old 12-29-2012, 12:17 AM   #4
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,407

Rep: Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853
you will need a new dedicated pygame3.SlackBuild for different reasons:
- /usr/bin/python3 must be launched in place of /usr/bin/python for the configure and setup phase of the python module;
- some python modules are still incompatible with python-3.x: luckily, in this case, the version in pygame's mercurial, beside being still at alpha stage, is given for compatible with python-3.x, so we have to use a snapshot of that;
- as it's dedicated to python3 and installs different stuff in different places from the one for python-2.x, the slackbuild should be renamed with a 3 at the end (and the various files adapted accordingly);

see the differences with the script for python-2.x

http://slackbuilds.org/repository/14.0/python/pygame/
http://ponce.cc/slackware/testing/pygame3/
 
1 members found this post helpful.
Old 01-19-2013, 10:55 PM   #5
MadMaverick9
Member
 
Registered: Aug 2010
Location: Here
Distribution: Slackware 14.0
Posts: 125

Rep: Reputation: Disabled
Whilst python keeps itself nicely separated ...

How do you deal with the issue that other python packages, like pygobject, don't keep themselves neatly separated? pygobject for example puts addtl. files in "/usr/include/pygtk-2.0/" ("usr/include/pygtk-2.0/pygobject.h"). How do you prevent pygobject from overwriting files that belong to a pygobject install for python 2?

Same question applies to wxPython and others. Because they all add files into directories like "/usr/include/" etc. which are not python version specific.

Why doesn't wxPython add its include files to "/usr/include/python2.x/"?

How have you solved or worked around this issue?
 
Old 01-19-2013, 11:12 PM   #6
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 435

Rep: Reputation: Disabled
Hi there MadMaverick9,

For me I install things like that into /opt as per the Filesystem Hierarchy Standard, so something like /opt/<package name>-<package version>/{lib,lib64,bin,share,...}, but you can also use /usr/local (which is already in the default $PATH anyways, so it might be easier for you).
 
Old 01-20-2013, 10:40 PM   #7
MadMaverick9
Member
 
Registered: Aug 2010
Location: Here
Distribution: Slackware 14.0
Posts: 125

Rep: Reputation: Disabled
Thanks for your reply TommyC7.

But my question was a pointless question as I just found out, since some packages like PyGTK don't even build with Python3. PyGTK uses some things like "dl_export" that have been deprecated since Python 2.3 and have been removed in Python 3.

So just forget that I asked.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I uninstall a python package installed with python setup.py install? milomak Linux - Software 1 11-16-2009 09:22 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
How do i install python 3.0 unixshell101 Fedora 1 12-04-2008 02:49 AM
install python 2.3 ,necssary to remove python 2.2 ngan_yine Linux - Newbie 7 12-28-2003 04:07 PM
Python install ixion Linux From Scratch 1 04-16-2003 10:00 AM


All times are GMT -5. The time now is 03:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration