_socket on solaris
Phil Eschallier
phil at buxtech.com
Wed May 1 17:59:28 EDT 2002
>>>>> "Fredrik" == Fredrik Lundh <fredrik at pythonware.com> writes:
> eli li wrote:
>> When I run my program on Solaris, the next message is printed.
>>
>> Traceback (most recent call last):
>> . . . . . . . . . . . . . . . . . . . . . File
>> "/usr/local/lib/python2.2/socket.py", line 41, in ? from
>> _socket import * ImportError: No module named _socket
>>
>> The reason is clear: file _socket is not found. Where can I
>> found this library?
> the _socket module is part of the standard distribution. if you
> don't have it, your install/configuration is broken.
> some possible reasons:
> - you're picking up a pre-2.2 interpreter, but have set the
> PYTHONHOME or PYTHONPATH environment variables to point to a
> newer standard library. to check this, just run "python"
> without any arguments, and look for the version number on the
> first line.
> - whoever installed python messed up, and failed to copy the
> extension modules. to check this, start the interpreter and
> type:
>>>> import sys sys.path
> look for a lib-dynload directory in the path, and check that
> there's a file called _socket.so (or _socketmodule.so) in that
> directory.
> - if this doesn't help, rebuild/double-check/reinstall (or ask
> your
> local friendly system administrator for help).
> </F>
Folks;
I'm in no way a Python expert ... but I've been playing with it under
Solaris for the last week, thinking that we should make the jump from
perl (a different thread).
I wanted to follow-up noting that the build process for Python under
Solaris is less than perfect. I've experienced this same _socket
module not being found and "yes", the build is broken.
The root of the issue is that the distutils used for compiling
determine the libs needed and add the -I / -L as needed. But no -R
options are added. My problem came from the fact that I have OpenSSL
deployed under /usr/local/ssl ... and the build process adds the -L to
find ssl.so and crypt.so ... but the resulting _socket.so does not
have the runtime path to the OpenSSL libs, the test load of _socket.so
fails, and it is removed from the build. The same holds for TK
support and one or two others.
Under Linux this is a non-issues as ldconfig is available.
My work-around for now is to add all the -L / -R directives I need to
the CC environment variable before running the initial 'configure'
script (because only hte CC and LDSHARED variables are passed from
Makefile to setyp.py).
I hope this helps ... and I hope that Python becomes more Solaris
friendly as it matures.
Cheers.
--
Phil Eschallier
Bux Technical Services
70 Irish Meetinghouse Rd
Perkasie, PA 18944
215.249.TECH (215.249.8324)
215.249.8325 (fax)
http://www.BuxTech.Com
More information about the Python-list
mailing list