classification
Title: Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?)
Type: compile error Stage:
Components: Installation Versions: Python 2.7
process
Status: open Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: Ari.Consul, asisco, dmalcolm, eraonel, hozn, loewis, orsenthil, spprakash
Priority: normal Keywords:

Created on 2010-08-18 05:22 by spprakash, last changed 2012-01-19 13:03 by eraonel.

Messages (12)
msg114196 - (view) Author: Prakash Palanivel (spprakash) Date: 2010-08-18 05:22
Server on Linux:gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)
Which "sunaudiodev" library i need to install on linux.

Kindly help me how to install or configure or avoid this issue.

Error:
Python build finished, but the necessary bits to build these modules were not found:
_tkinter           bsddb185           sunaudiodev     
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
msg114197 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-08-18 05:55
You are misinterpreting what you are seeing. The message you get is not an error message. It works all fine, and correctly. To build the sunaudiodev module, you need Sun/Oracle Solaris, not Linux.
msg114199 - (view) Author: Prakash Palanivel (spprakash) Date: 2010-08-18 06:05
After complete the installation the below error message was displayed.Kindly check and revert.
./python -E ./setup.py install \
   	--prefix=/usr/local/python-2.7 \
	--install-scripts=/usr/local/python-2.7/bin \
	--install-platlib=/usr/local/python-2.7/lib/python2.7/lib-dynload \
	--root=/
make: execvp: ./python: Text file busy
make: *** [sharedinstall] Error 127
msg114202 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-08-18 06:29
What file system is this on?
msg114203 - (view) Author: Prakash Palanivel (spprakash) Date: 2010-08-18 07:40
After Installed the following error was through:

PYTHONPATH=/usr/local/Python-2.7/lib/python2.7   \
	./python -Wi -tt /usr/local/Python-2.7/lib/python2.7/compileall.py \
	-d /usr/local/Python-2.7/lib/python2.7 -f \
	-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
	/usr/local/Python-2.7/lib/python2.7
Traceback (most recent call last):
  File "/usr/local/Python-2.7/lib/python2.7/compileall.py", line 17, in <module>
    import struct
  File "/usr/local/Python-2.7/lib/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
make: *** [libinstall] Error 1
msg114205 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-08-18 08:19
spprakash, do the following, in your python2.7 checkout (or download):
do 
make distclean
./configure
make
make install

If there is any failure in make/make install of the above steps, please paste that error message and also provide the file system type
(run  df -T)
msg114220 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2010-08-18 14:01
(BTW, the versioning seems slightly misleading: "(Red Hat 4.1.0-3)" refers to the version of GCC, not of the operating system.

You appear to be running gcc-4.1.0-3, which I believe was shipped in Fedora Core 5.

Updating "title" metadata of the bug accordingly)
msg122056 - (view) Author: Ari Consul (Ari.Consul) Date: 2010-11-22 01:25
Similar error on make install.  Using Centos 5

/usr/bin/install -c -m 644 ./LICENSE /home/ac927k/local/Python-2.7/lib/python2.7/LICENSE.txt
PYTHONPATH=/home/ac927k/local/Python-2.7/lib/python2.7   \
                ./python -Wi -tt /home/ac927k/local/Python-2.7/lib/python2.7/compileall.py \
                -d /home/ac927k/local/Python-2.7/lib/python2.7 -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                /home/ac927k/local/Python-2.7/lib/python2.7
Traceback (most recent call last):
  File "/home/ac927k/local/Python-2.7/lib/python2.7/compileall.py", line 17, in <module>
    import struct
  File "/home/ac927k/local/Python-2.7/lib/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
make: *** [libinstall] Error 1


[1]+  Exit 2                  make install >&~/python2.7_make_install.log
[ac927k@limbo Python-2.7]$ clear
[ac927k@limbo Python-2.7]$ df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
              ext3    73608360  11832396  57976516  17% /
/dev/sda1     ext3      101086     26199     69668  28% /boot
tmpfs        tmpfs     1029736         0   1029736   0% /dev/shm
[ac927k@limbo Python-2.7]$ uname -av
Linux limbo.local 2.6.18-194.8.1.el5 #1 SMP Thu Jul 1 19:04:48 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[ac927k@limbo Python-2.7]$ cat /etc/redhat-release
CentOS release 5.5 (Final)
[ac927k@limbo Python-2.7]$
msg133763 - (view) Author: sisco (asisco) Date: 2011-04-14 19:21
make install fails on Fedora Core 13 as well:

make distclean
./configure
make
make install

/usr/bin/install -c -m 644 ./LICENSE /usr/local/lib/python2.7/LICENSE.txt
PYTHONPATH=/usr/local/lib/python2.7   \
                ./python -Wi -tt /usr/local/lib/python2.7/compileall.py \
                -d /usr/local/lib/python2.7 -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                /usr/local/lib/python2.7
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/compileall.py", line 17, in <module>
    import struct
  File "/usr/local/lib/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
make: *** [libinstall] Error 1
[root@freebie Python-2.7.1]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda3     ext4    50395844   2899168  46984864   6% /
tmpfs        tmpfs     2020464       864   2019600   1% /dev/shm
/dev/sda1     ext4      396672     29566    346626   8% /boot
/dev/sda2     ext4   898537912 146927532 705967272  18% /db
[root@freebie Python-2.7.1]# uname -av
Linux freebie 2.6.33.3-85.fc13.x86_64 #1 SMP Thu May 6 18:09:49 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@freebie Python-2.7.1]# cat /etc/fedora-release
Fedora release 13 (Goddard)
msg133913 - (view) Author: Hans Lellelid (hozn) Date: 2011-04-17 00:12
I'm having apparently the same issue when attempting to build an RPM (based on EPEL 2.6.5 SPEC) on CentOS 5.5 i386.

A straight configure/make/make install will work fine, but when editing Modules/Setup.dist to enabled *shared* (and then uncommenting the modules that I want to enable), and passing  --enable-shared to configure, I now get the following error during make-install phase:

PYTHONPATH=/var/tmp/python27-2.7.1-1.wt_el5-root-hans//usr/lib/python2.7  LD_LIBRARY_PATH=/home/hans/rpm/python27/Python-2.7.1: \
                ./python -Wi -tt /var/tmp/python27-2.7.1-1.wt_el5-root-hans//usr/lib/python2.7/compileall.py \
                -d /usr/lib/python2.7 -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                /var/tmp/python27-2.7.1-1.wt_el5-root-hans//usr/lib/python2.7
Traceback (most recent call last):
  File "/var/tmp/python27-2.7.1-1.wt_el5-root-hans//usr/lib/python2.7/compileall.py", line 17, in <module>
    import struct
  File "/var/tmp/python27-2.7.1-1.wt_el5-root-hans/usr/lib/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct

I have cleaned out and rebuilt this many times.  I'm going to continue digging to see if I can figure out how to get the the .so files in the right place (or put the right dir on the path).  I'm also curious what changed from version 2.6 in this regard (and hopefully I'll figure it out with some more work).
msg133918 - (view) Author: Hans Lellelid (hozn) Date: 2011-04-17 03:14
Ok, I think I have tracked down the problem to a change that happened in site.py.  In comparing against a build that worked fine for Python 2.6.5, I noticed that the Modules subdir (which contains the shared .so files) was present on the sys.path for Python 2.6 but not for 2.7.  Digging deeper let me to the site.py module.  In Python 2.7 the behavior was changed so that the Modules path element was removed from sys.path. 

This is probably best explained by the patch I applied to revert to 2.6.x behavior, which fixed the compile problem for me:

--- Python-2.7.1/Lib/site.py    2010-10-12 18:53:51.000000000 -0400
+++ Python-2.7.1/Lib/site.py.addbuilddir-revert 2011-04-16 23:03:47.000000000 -0400
@@ -122,7 +122,7 @@
     s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
     if hasattr(sys, 'gettotalrefcount'):
         s += '-pydebug'
-    s = os.path.join(os.path.dirname(sys.path.pop()), s)
+    s = os.path.join(os.path.dirname(sys.path[-1]), s)
     sys.path.append(s)

Obviously I imagine there was a reason why this change was made, so the above patch is probably not an appropriate universal fix.  I don't know anything about the original reasoning, but this change does seem to work for me on CentOS 5.5 now.

Notably, the issue I'm describing doesn't appear to have anything to do with gcc.  (Incidentally, I'm using gcc-4.1.2-48.el5.)
msg151618 - (view) Author: mike (eraonel) Date: 2012-01-19 13:03
Hi,

I downloaded source and did the following instructions.


We use Red Hat Enterprise Linux Server release 5.5.

./configure --prefix=/home/mike/python_rh_32
make
make install

I also changed the line in site.py

from:
    
s = os.path.join(os.path.dirname(sys.path.pop()), s)

to:

s = os.path.join(os.path.dirname(sys.path[-1]), s)

but I still get:

/usr/bin/install -c -m 644 ./LICENSE /home/mike/python_rh_32/lib/python2.7/LICENSE.txt
PYTHONPATH=/home/mike/python_rh_32/lib/python2.7   \
                ./python -Wi -tt /home/mike/python_rh_32/lib/python2.7/compileall.py \
                -d /home/mike/python_rh_32/lib/python2.7 -f \
                -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
                /home/mike/python_rh_32/lib/python2.7
Traceback (most recent call last):
  File "/home/mike/python_rh_32/lib/python2.7/compileall.py", line 16, in <module>
    import struct
  File "/home/mike/python_rh_32/lib/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
make: *** [libinstall] Error 1


Did anyone slove this problem?
History
Date User Action Args
2012-01-19 13:03:18eraonelsetnosy: + eraonel
messages: + msg151618
2011-04-17 03:14:44hoznsetmessages: + msg133918
2011-04-17 00:12:03hoznsetnosy: + hozn
messages: + msg133913
2011-04-14 19:21:50asiscosetnosy: + asisco
messages: + msg133763
2010-11-22 01:25:51Ari.Consulsetnosy: + Ari.Consul
messages: + msg122056
2010-08-18 14:01:10dmalcolmsetnosy: + dmalcolm

messages: + msg114220
title: Python 2.7 installation issue for Linux Red Hat 4.1 -> Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?)
2010-08-18 08:19:42orsenthilsetnosy: + orsenthil
messages: + msg114205
2010-08-18 07:40:12spprakashsetmessages: + msg114203
2010-08-18 06:29:15loewissetmessages: + msg114202
2010-08-18 06:05:34spprakashsetstatus: closed -> open

messages: + msg114199
2010-08-18 05:55:12loewissetstatus: open -> closed

nosy: + loewis
messages: + msg114197

resolution: invalid
2010-08-18 05:23:29spprakashsettype: compile error
2010-08-18 05:22:32spprakashcreate