Problems with PYTHONPATH in generated Makefile for 2.1

Steve Waterbury steve.waterbury at gsfc.nasa.gov
Mon Jun 18 11:45:13 EDT 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 
setup.py, 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 ./setup.py build
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "./setup.py", 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:

# PYTHONPATH=$(COREPYTHONPATH)
# COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(TKPATH)

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

PYTHONPATH=$SRCDIR:$SRCDIR/Lib
export PYTHONPATH

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