[issue9631] Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?)

Space Li report at bugs.python.org
Wed Feb 29 02:49:19 CET 2012


Space Li <spacelis at gmail.com> added the comment:

Hi,

I recently compiled Python 2.7.2 and got an ImportError on struct module during 'make install'. 

What I found working for me is just to 'make'. Before doing 'make install', copy the lib.linux-xxxxx directory in 'build' to {prefix}/lib/python2.7 and rename it as lib-dynload.

Then find something that looks like followings:
        $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
        PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST) -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                $(DESTDIR)$(LIBDEST)
        PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST) -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                $(DESTDIR)$(LIBDEST)
        -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST)/site-packages -f \
                -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
        -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST)/site-packages -f \
                -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
        -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"

Add :$(DESTSHARED) behind each PYTHONPATH. Then it looks like

        $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
        PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED)  $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST) -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                $(DESTDIR)$(LIBDEST)
        PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST) -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                $(DESTDIR)$(LIBDEST)
        -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED)  $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST)/site-packages -f \
                -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
        -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST)/site-packages -f \
                -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
        -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"

After doing so, you can 'make install'.

This is tested on OpenSUSE 10.3 with GCC 4.2.1.

----------
nosy: +spaceli

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9631>
_______________________________________


More information about the Python-bugs-list mailing list