This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spaceli
Recipients Ari.Consul, asisco, dmalcolm, eraonel, eric.araujo, flox, hozn, loewis, miro_ilias, orsenthil, spaceli, spprakash
Date 2012-02-29.01:49:18
SpamBayes Score 1.1757807e-07
Marked as misclassified No
Message-id <1330480159.89.0.133099991131.issue9631@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-02-29 01:49:20spacelisetrecipients: + spaceli, loewis, orsenthil, eric.araujo, hozn, flox, dmalcolm, spprakash, Ari.Consul, asisco, eraonel, miro_ilias
2012-02-29 01:49:19spacelisetmessageid: <1330480159.89.0.133099991131.issue9631@psf.upfronthosting.co.za>
2012-02-29 01:49:19spacelilinkissue9631 messages
2012-02-29 01:49:18spacelicreate