ImportError: No module named _md5

2

1

I am trying to install Altera's Quartus 10 web edition 32 bit (but I think only the 32bit part is relevant to my problem) on Fedora 14 (x86_64bit), which runs inside a VM.

When I run the installer:

./altera_installer_cmd --install=quartus_free (...and some more options)

I get the following error:

Traceback (most recent call last):  
File "<string>", line 18, in <module> 
File "/tools/python/2.6.4/linux32/pyinstaller/iu.py",
line 436, in importHook   
File "/tools/python/2.6.4/linux32/pyinstaller/iu.py",
line 521, in doimport   
File "linux32/build/pyi.linux2/quartus_dl/outPYZ1.pyz/hashlib",
line 136, in <module>   
File "linux32/build/pyi.linux2/quartus_dl/outPYZ1.pyz/hashlib",
line 63, in __get_builtin_constructor 
File "/tools/python/2.6.4/linux32/pyinstaller/iu.py",
line 455, in importHook ImportError:
No module named _md5

I have no idea where those files are located, because it seems like the path /tools doesn't exist.

And it seems like, that the installer wants to use python 2.6.4 while my regular installation uses python 2.7

$python --version
Python 2.7

Does anybody have an idea how to fix this?

Edit 1: (edited out a part for brevity)

The installer is unfortunately a binary file:

$ file altera_installer_cmd
altera_installer_cmd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
$ ldd altera_installer_cmd
    linux-gate.so.1 =>  (0x00424000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00990000)
    libdl.so.2 => /lib/libdl.so.2 (0x007c7000)
    libutil.so.1 => /lib/libutil.so.1 (0x00fc0000)
    libm.so.6 => /lib/libm.so.6 (0x006bf000)
    libz.so.1 => /lib/libz.so.1 (0x0069f000)
    libc.so.6 => /lib/libc.so.6 (0x4b653000)
    /lib/ld-linux.so.2 (0x4b62f000)

Here is a list of all the files and folders inside the directory of the installer. As you can see, there is no folder /tools. But there is a file _hashlib.so (line 27).

Edit 2: I reinstalled python and after that imported hashlib without a problem:

# python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) 
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> exit()

after that I ran the altera_installer_cmd as described above with the same error. If I now run the python and import hashlib I get again the error

$ python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) 
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/hashlib.py", line 136, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib64/python2.7/hashlib.py", line 74, in __get_builtin_constructor
    import _sha256
ImportError: ./_sha256.so: wrong ELF class: ELFCLASS32
>>> 

Lucas

Posted 2010-11-17T23:05:14.853

Reputation: 629

Is the tools directory in the same directory as altera_installer_cmd? Does your Python 2.7 installation come with hashlib? I don't feel like signing up for MyAltera to download this software to test, so if you could put relevant install files on pastebin that would be very useful.

– fideli – 2010-11-18T03:06:41.877

@fideli: I added some some information. If there is any other information I should provide, please tell me. Thanks a lot. – Lucas – 2010-11-18T08:41:37.693

See if you can update/reinstall your Python packages. On my Fedora 14, import hashlib works perfectly fine. Having said that, you may still face an issue with the 32-bit Altera on your 64-bit system. – fideli – 2010-11-18T14:07:54.497

@fideli: I reinstalled python but that didn't help. Any other ideas? – Lucas – 2010-11-19T09:50:45.627

@Lucas Well it looks like your altera_installer_cmd messes up your _sha256.so because it did work before, as you point out. The error that appears after is because you run 64Bit and it appears to have changed to a 32Bit Binary. Maybe it's not the actual _sha256.so but instead a modified python path that has the 32Bit version of that file in a prior position. – snies – 2012-01-26T04:26:15.730

@Lucas Try the install in a 32Bit Ubuntu install (since you already use virtual machines this should be easy). If you want to understand what the altera_installer_cmd exactly does try monitoring it's execution with strace (you have to be root). It monitors all system calls (including the "open" call) so it shows you all files that get opened. You should dump the strace output to a file and than analyse, as is quite verbose. – snies – 2012-01-26T04:30:08.953

No answers