Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 157692

Summary: sys-apps/portage ImportError: No module named _socket
Product: Portage Development Reporter: alfredtaipei <alfredh>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED CANTFIX    
Severity: normal    
Priority: High    
Version: 2.1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description alfredtaipei 2006-12-09 21:41:53 UTC
I do not know this is a bug or other problem.
==========================================================================

dahua portage-2.1.1 # etc-update


!!! Failed to complete portage imports. There are internal modules for
!!! portage and failure here indicates that you have a problem with your
!!! installation of portage. Please try a rescue portage located in the
!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).
!!! There is a README.RESCUE file that details the steps required to perform
!!! a recovery of portage.
    No module named _socket

Traceback (most recent call last):
  File "/usr/lib/portage/bin/portageq", line 341, in ?
    main()
  File "/usr/lib/portage/bin/portageq", line 333, in main
    import portage
  File "/usr/lib/portage/pym/portage.py", line 55, in ?
    import getbinpkg
  File "/usr/lib/portage/pym/getbinpkg.py", line 10, in ?
    import htmllib,HTMLParser,string,formatter,sys,os,xpak,time,tempfile,base64,urllib2
  File "/usr/lib/python2.4/urllib2.py", line 91, in ?
    import ftplib
  File "/usr/lib/python2.4/ftplib.py", line 45, in ?
    import socket
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
Scanning Configuration files...
Exiting: Nothing left to do; exiting. :)

==============================================================================
emerge -upv portage, emerge --search portage, emerge portage, emerge --sync, ...  all have the same error.
And the emerge --info same.

==============================================================================
dahua portage-2.1.1 # emerge --info


!!! Failed to complete portage imports. There are internal modules for
!!! portage and failure here indicates that you have a problem with your
!!! installation of portage. Please try a rescue portage located in the
!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).
!!! There is a README.RESCUE file that details the steps required to perform
!!! a recovery of portage.
    No module named _socket

Traceback (most recent call last):
  File "/usr/bin/emerge", line 28, in ?
    import portage
  File "/usr/lib/portage/pym/portage.py", line 55, in ?
    import getbinpkg
  File "/usr/lib/portage/pym/getbinpkg.py", line 10, in ?
    import htmllib,HTMLParser,string,formatter,sys,os,xpak,time,tempfile,base64,urllib2
  File "/usr/lib/python2.4/urllib2.py", line 91, in ?
    import ftplib
  File "/usr/lib/python2.4/ftplib.py", line 45, in ?
    import socket
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket

=============================================================================
Thanks!
Comment 1 Zac Medico gentoo-dev 2006-12-10 02:05:15 UTC
(In reply to comment #0)
> I do not know this is a bug or other problem.

Apparently your python install is broken.  Maybe you can get it working long enough to rebuild python if you comment out the 'import getbinpkg' in /usr/lib/portage/pym/portage.py.
Comment 2 alfredtaipei 2006-12-10 05:48:35 UTC
(In reply to comment #1)
> Apparently your python install is broken.  Maybe you can get it working long
> enough to rebuild python if you comment out the 'import getbinpkg' in
> /usr/lib/portage/pym/portage.py.
> 

Thanks!
The etc-update is OK, but others still cannot work.

=============================================================================

dahua alfred # etc-update
Scanning Configuration files...
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/skel/.bashrc (1)
2) /etc/bash/bashrc (1)
Please select a file to edit by entering the corresponding number.
              (don't use -3, -5, -7 or -9 if you're unsure what to do)
              (-1 to exit) (-3 to auto merge all remaining files)
                           (-5 to auto-merge AND not use 'mv -i')
                           (-7 to discard all updates)
                           (-9 to discard all updates AND not use 'rm -i'): -5

Replacing /etc/skel/.bashrc with /etc/skel/._cfg0000_.bashrc


Replacing /etc/bash/bashrc with /etc/bash/._cfg0000_bashrc

Exiting: Nothing left to do; exiting. :)
==============================================================================
dahua alfred # emerge -upv portage
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
==============================================================================
dahua alfred # emerge -upv python
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
===============================================================================
dahua alfred # emerge -pv python
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
==============================================================================
dahua alfred # emerge python
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
==============================================================================
dahua alfred # emerge --info
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
===============================================================================
dahua alfred # emerge --sync
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
  File "/usr/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket
===============================================================================

Thanks!
Comment 3 Zac Medico gentoo-dev 2006-12-10 11:45:18 UTC
You can temporarily remove "socket" from that line in /usr/bin/emerge since it's only used by `emerge --sync`.