Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Stupidly unmerged Python
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
xeonman9000
n00b
n00b


Joined: 06 Aug 2008
Posts: 51
Location: UK

PostPosted: Sat Apr 11, 2009 7:12 pm    Post subject: [SOLVED] Stupidly unmerged Python Reply with quote

Hi,
I stupidly unmerged Python and therefore emerge no longer works, I've been googling like mad and have tried a couple of solutions, but neither have worked:
http://www.linuxquestions.org/questions/linux-distributions-5/unmerged-python-in-gentoo-system-224430/
https://forums.gentoo.org/viewtopic-t-5746-highlight-unmerged+python.html
In the second link, it says
delta407 wrote:
You might be able to reinstall Python using this:
Code:
# cd
# tar xzf /usr/portage/distfiles/Python-2.2.1.tgz
# cd Python-2.2.1
# ./configure --with-fpectl --infodir=/usr/share/info/ --mandir=/usr/share/man
# make
# make install prefix=/usr
# rm /usr/bin/python 2>/dev/null
# ln -s /usr/bin/python2 /usr/bin/python


This fails at the make install stage:

Code:
...
Compiling /usr/lib/python2.5/xml/sax/_exceptions.py ...
Compiling /usr/lib/python2.5/xml/sax/expatreader.py ...
Compiling /usr/lib/python2.5/xml/sax/handler.py ...
Compiling /usr/lib/python2.5/xml/sax/saxutils.py ...
Compiling /usr/lib/python2.5/xml/sax/xmlreader.py ...
Compiling /usr/lib/python2.5/xmllib.py ...
Compiling /usr/lib/python2.5/xmlrpclib.py ...
Compiling /usr/lib/python2.5/zipfile.py ...
make: *** [libinstall] Error 1


I thought it was about time to ask for some help before I break it any further.
Thanks.

Code:

lambert Python-2.5.2 # uname -a
Linux lambert 2.6.25-gentoo-r7 #1 SMP Mon Aug 4 01:30:36 BST 2008 x86_64 Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz GenuineIntel GNU/Linux


Last edited by xeonman9000 on Sun Apr 19, 2009 5:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
WalmartSniperLX
n00b
n00b


Joined: 30 Mar 2007
Posts: 29

PostPosted: Sat Apr 11, 2009 8:43 pm    Post subject: Reply with quote

Have you tried installing and/or compiling Python from an external source?
_________________
Join me in the "Leave no thread unanswered" act. The quest to leave no thread left unanswered.
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sat Apr 11, 2009 9:53 pm    Post subject: Reply with quote

Try grabbing a python tarball from here and untarring the tarball to /
http://tinderbox.dev.gentoo.org/
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
xeonman9000
n00b
n00b


Joined: 06 Aug 2008
Posts: 51
Location: UK

PostPosted: Sat Apr 11, 2009 11:22 pm    Post subject: Reply with quote

Sorry for sounding like a complete n00b, but those folders only contain .ebuild files, no tarballs containing the source code. Where can i get these from?
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sun Apr 12, 2009 12:09 am    Post subject: Reply with quote

xeonman9000 wrote:
Sorry for sounding like a complete n00b, but those folders only contain .ebuild files, no tarballs containing the source code. Where can i get these from?
http://tinderbox.dev.gentoo.org/default-linux/x86/dev-lang/
This is for x86. Change to different directory depending on your ARCH.
By the way, these are NOT source codes. These are the ready-to-install binaries.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Thu Apr 16, 2009 12:48 am    Post subject: Reply with quote

xeonman9000 wrote:
Sorry for sounding like a complete n00b, but those folders only contain .ebuild files, no tarballs containing the source code. Where can i get these from?


I think you can just download this python if you are using the x86 arch and then move it to /

then as root
Code:


tar -jxvf foo.bz2



where foo is the package name.

Hope this works for ya.
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 683

PostPosted: Thu Apr 16, 2009 7:19 am    Post subject: Reply with quote

If it were me:
Code:
tar -xvaf /usr/portage/distfiles/python-2.most.recent.version.tar.gz
cd python-most.recent
./configure
make
make install
emerge -1 python
make uninstall
emerge -1 python
No matter what you do, make sure that when you're done you delete the files you create - having cruft associated with a compiler can be problematic.
Back to top
View user's profile Send private message
xeonman9000
n00b
n00b


Joined: 06 Aug 2008
Posts: 51
Location: UK

PostPosted: Sun Apr 19, 2009 5:27 pm    Post subject: Reply with quote

bobspencer123 wrote:
xeonman9000 wrote:
Sorry for sounding like a complete n00b, but those folders only contain .ebuild files, no tarballs containing the source code. Where can i get these from?


I think you can just download this python if you are using the x86 arch and then move it to /

then as root
Code:


tar -jxvf foo.bz2



where foo is the package name.

Hope this works for ya.


Thanks a lot, that worked a treat. All I had to do after the extraction was make a symbolic link from /usr/bin/python to /usr/bin/python2.5.

pigeon768 wrote:
If it were me:
Code:
tar -xvaf /usr/portage/distfiles/python-2.most.recent.version.tar.gz
cd python-most.recent
./configure
make
make install
emerge -1 python
make uninstall
emerge -1 python
No matter what you do, make sure that when you're done you delete the files you create - having cruft associated with a compiler can be problematic.

Thanks for the suggestion. Unfortunately I recently ran an eclean and no longer had the sources.
Back to top
View user's profile Send private message
randalla
Tux's lil' helper
Tux's lil' helper


Joined: 14 Oct 2008
Posts: 79
Location: Seattle, WA

PostPosted: Fri Apr 24, 2009 6:19 pm    Post subject: Reply with quote

pigeon768 wrote:
If it were me:
Code:
tar -xvaf /usr/portage/distfiles/python-2.most.recent.version.tar.gz
cd python-most.recent
./configure
make
make install
emerge -1 python
make uninstall
emerge -1 python
No matter what you do, make sure that when you're done you delete the files you create - having cruft associated with a compiler can be problematic.


In some unfortunate irony, I mistakenly removed python as well (trying to fix a broken build in the evening). I followed what you recommended and it worked quite well. I did have to some extra steps, however:

1) The Python source archive, which has a capital P, is a bzip2, not gzip, tar archive.
2) Emerge did not work initially as python was installed into the /usr/local directory. I had to create a symlink in /usr/bin to the newly installed python in /usr/local/bin
3) I did not use the -1 as I do want it added to the world tree
4) There is no make uninstall for Python it seems, I had to remove the files in /usr/local by hand.

At the end I did follow the emerge instructions and ran /usr/sbin/python-updater, though I don't know if that was necessary.

Adam.
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Fri Apr 24, 2009 7:53 pm    Post subject: Reply with quote

Moved from Portage & Programming to Duplicate Threads.
See this post for the most efficient solution to this common problem.
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum