Question

I have a code created by Jeff Shufelt on artificial neural networks and i like to run some traing and testing of datas in some photos but whenever i run his program i get this error.

Traceback (most recent call last): 
File "run_ann.py", line 3, in <module>
  import ann
File "/media/405A4CA95A4C9E12/Users/User/Desktop/me3-4/ann/src/linux/python/ann.py",   
line 26, in <module>
  _ann = swig_import_helper()
File "/media/405A4CA95A4C9E12/Users/User/Desktop/me3-4/ann/src/linux/python/ann.py",
line 22, in swig_import_helper
  _mod = imp.load_module('_ann', fp, pathname, description)
ImportError: /media/405A4CA95A4C9E12/Users/User/Desktop/me3-4/ann/src/linux/python
/_ann.so: wrong ELF class: ELFCLASS32
Was it helpful?

Solution

Looks like your Python process is 64 bit (or at least not 32bit) and can't load a 32 bit library (_ann.so, ELFCLASS32). See if you can get a 64bit version of that library.

OTHER TIPS

Looks like an architecture issue? If you are running a fat python binary that has both 32 and 64 bit in it you could just extract the 64 bit part and force python to just use that.

lipo -info ../bin/python
>>Architectures in the fat file: ../bin/python are: i386 x86_64
cp ../bin/python ../bin/python-universal
lipo ../bin/python-universal -thin x86_64 -output ../bin/python

And you should be sweet.

Edit: Oh, just do this if you are running in a virtualenv. Otherwise you run the risk of messing up other things on your machine!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top