Problems with PYTHONPATH in generated Makefile for 2.1

Steve Waterbury steve.waterbury at
Mon Jun 18 17:45:13 CEST 2001

There seems to be a problem with the way PYTHONPATH is set up in 
the configure-generated Makefile for Python 2.1.

In order to build Python 2.1 from source on Solaris (I don't know 
about other platforms), I had to make some adjustments.  I'm not 
sure if the way I did it was the best way.  

Specifics:  I was trying to build Python 2.1 on Solaris 2.6 
(on a SPARC 20), using Sun's compiler (Sun WorkShop 6 update 1 
C 5.2 2000/09/11).  Every time the build process got down to, it would die, saying (some additional lines are 
quoted for context):

cc -mt  -o python \
		Modules/ccpython.o \
		libpython2.1.a -lpthread -lsocket -lnsl -ldl  -lthread   -lm  
PYTHONPATH= ./python ./ build
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "./", line 9, in ?
    import sys, os, getopt
ImportError: No module named os
*** Error code 1
make: Fatal error: Command failed for target `sharedmods'

I got it to work by commenting out the following statements in 
the Makefile:


... and setting PYTHONPATH in root's environment as


I don't really know if this is the right solution, but I know there 
is a problem, and this appeared to solve it.

-- Steve.

More information about the Python-list mailing list