[Buildbot-devel] can't get twisted to install on sun

Brian Warner warner-buildbot at lothar.com
Thu Jan 15 20:00:05 UTC 2004


>   File "/usr/local/lib/python2.2/socket.py", line 41, in ?
>     from _socket import *
> ImportError: No module named _socket

My hunch is that you have a mangled python installation. Do a big find(1) of
_socket.so (the file it's actually trying to load) and see where it lives (if
anywhere). Something like "find /usr -name _socket.so".

On my linux (debian) installation, it lives in a subdirectory named
"lib-dynload", which shows up in the built-in sys.path list. This is one of
those directories that probably gets hard-coded into the executable when you
build it (the same "build-time installation path" vs "run-time installation
path" issue that affects perl, emacs, gcc, pretty much anything which loads
component files at runtime).

It's possible that your python was told (or defaulted) to live in /usr/ when
it was compiled, but then told to install into /usr/local/, and the sys.path
is still pointing at the wrong place. It is common for /usr/local to be
included in the PYTHONPATH so that site-local modules can be used, and maybe
that's why it works at all.

Do a "python -c 'import sys; print sys.path'" and see if that list contains
the lib-dynload directory that _socket.so was installed into.

It is also possible that python was unable to find the networking libraries
when it was compiled, and therefore just left out socket support. If I
remember right, Solaris requires you to link against "-lsocket -lnsl" in
additio to the usual libc. Python's configure process should know about this,
but maybe something went wrong. If you can find a _socket.so, then python
knew how to do socket stuff and it's just a question of finding the shared
object once more.


 -Brian




More information about the devel mailing list