how to build with python 3 when 2 is the default one[Solved]

Discussions Regarding Software

Moderator: Moderators

Post Reply
msdobrescu
Old Dear Hen
Posts: 577
Joined: Sun Aug 21, 2011 8:48

how to build with python 3 when 2 is the default one[Solved]

Post by msdobrescu » Mon Feb 13, 2012 6:07

Hello,

I try to build dupeGuru (http://www.hardcoded.net/dupeguru/).
It seems to request python 3.

Code: Select all

ImportError: No module named builtins/code]

I have python 2 and 3 installed, but 2 is the default one and I wouldn't make the 3 as default:

[code]python -V
Python 2.7.2
How could it be done?

Thank you.
Last edited by msdobrescu on Mon Feb 13, 2012 21:48, edited 1 time in total.

User avatar
sabayonino
Sagely Hen
Posts: 3190
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: how to build with python 3 when 2 is the default one

Post by sabayonino » Mon Feb 13, 2012 12:41

Hi

You can install python3 from entropy and switch it using eselect python command

build your package and then remember to switch to python2.7 becaus most applications are not supported from python3

check available python list

Code: Select all

# eeselect python list
Set python profile

Code: Select all

# eselect python set X
where "X" is the index of python showed

Example :

Code: Select all

# eselect python list
Available Python interpreters:
  [1]   python2.7 *
  [2]   python3.2
To switch from 2.7 to 3.2 type :

Code: Select all

@ eselect python set 2
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

msdobrescu
Old Dear Hen
Posts: 577
Joined: Sun Aug 21, 2011 8:48

Re: how to build with python 3 when 2 is the default one

Post by msdobrescu » Mon Feb 13, 2012 18:06

Thank you,

Now, I have the following error:

Code: Select all

eselect python set 2
!!! Error: Cannot remove symlinks
exiting

User avatar
sabayonino
Sagely Hen
Posts: 3190
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: how to build with python 3 when 2 is the default one

Post by sabayonino » Mon Feb 13, 2012 20:10

msdobrescu wrote:Thank you,

Now, I have the following error:

Code: Select all

eselect python set 2
!!! Error: Cannot remove symlinks
exiting

run the command as Root !
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

msdobrescu
Old Dear Hen
Posts: 577
Joined: Sun Aug 21, 2011 8:48

Re: how to build with python 3 when 2 is the default one

Post by msdobrescu » Mon Feb 13, 2012 21:48

Thank you, it worked!

Post Reply