[Python-bugs-list] [ python-Bugs-425007 ] Python 2.1 final broken on Linux!!!

noreply@sourceforge.net noreply@sourceforge.net
Sat, 19 May 2001 17:16:47 -0700


Bugs item #425007, was updated on 2001-05-17 16:28
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=425007&group_id=5470

Category: Installation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python 2.1 final broken on Linux!!!

Initial Comment:
I have gone back and tried Python 1.6 and 2.0.  Both
work fine.  When I install Python 2.1, everything is
broken.  The problem is that when a module is a shared
library (.so), python refuses to load the module.  Example:

import os
import sys
import SocketServer

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.1/SocketServer.py", line 126, in ?
    import socket
  File "/usr/lib/python2.1/socket.py", line 41, in ?
    from _socket import *
ImportError: No module named _socket

Now, do a "locate _socket.so" and I get:
/usr/lib/python2.1/site-packages/_socket.so
/usr/lib/python2.1/lib-dynload/_socket.so


Clearly they are there, it's just that Python refuses
to load them.


I made Python 2.1 from source as fetched from the 2.1
tar ball.  It makes cleanly.  During the installation,
I see some items that I believe to be minor that popup,
but don't currectly expect that they are the problem. 
I have tried many times using different configure
options to get this to work, deleting the previous
installation each time.  I've even tried installing in
different locations.

As is, Python 2.1 is completely broken for me.  Surely
I'm not the only one having this problem, especially
since 1.5, 1.6, and 2.0 all work correctly.

Any help would be great.  BTW, doing a "print sys.path"
gives me: ['', '/usr/lib/python2.1',
'/usr/lib/python2.1/plat-linux2',
'/usr/lib/python2.1/lib-tk',
'/usr/lib/python2.1/lib-dynload',
'/usr/lib/python2.1/site-packages']

As you can see, lib-dynload is in the path, so I'm not
really sure what's going on.

----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2001-05-19 17:16

Message:
Logged In: YES 
user_id=149084

Well, import SocketServer works ok for me with Python built
both from the 2.1 tar file and the 2.2a0 CVS tree. I'm
running Linux 2.2.5 (RH 6.2) on Pentium.

Did you make clean after changing the configure options?

It is not normal to have _socket.so in .../site-packages; it
should be only in .../lib-dynload.  Default installation has
only the README file in site-packages.

Your sys.path looks normal, except that Python default
installs at /usr/local/[bin/lib].  I tried a build targeted
at /usr/[bin/lib] and it was ok.

You could try make clobber, but it's almost as fast to start
over. Try a vanilla installation:
1. delete your install tree @ /usr/local/lib/python2.1
(and/or /usr/lib)
2. delete your source tree from wherever you unpacked the
tar file.
3. untar again, cd to source directory it created
4. without changing any files, and no configure options, run
./configure, then make, then make install

If that doesn't help, what Linux are you running, on what
box, and where did you get your 2.1 tar file?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=425007&group_id=5470