Добрый день! Балуюсь с r2-bindings из проекта radare2 (http://radare.org). Большей частью меня интересуют питоновские модули. Скомпилировал, установил успешно в /usr/lib/python2.7/site-packages/r2. Однако при попытке загрузить модуль вываливается ошибка:
Python 2.7.2 (default, Oct 17 2011, 22:46:26)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import r2.r_core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/r2/r_core.py", line 30, in <module>
_r_core = swig_import_helper()
File "/usr/lib/python2.7/site-packages/r2/r_core.py", line 22, in swig_import_helper
import _r_core
ImportError: No module named _r_core
>>> import r2.core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named core
>>> import r_core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named r_core
>>> import r2.r_core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/r2/r_core.py", line 30, in <module>
_r_core = swig_import_helper()
File "/usr/lib/python2.7/site-packages/r2/r_core.py", line 22, in swig_import_helper
import _r_core
ImportError: No module named _r_core
--- replaced obj /usr/lib/python2.7/site-packages/r2/r_core.py
--- replaced obj /usr/lib/python2.7/site-packages/r2/r_bin.py
--- replaced obj /usr/lib/python2.7/site-packages/r2/r_asm.py
--- replaced obj /usr/lib/python2.7/site-packages/r2/_r_bin.so
--- replaced obj /usr/lib/python2.7/site-packages/r2/_r_asm.so
--- replaced obj /usr/lib/python2.7/site-packages/r2/__init__.py
--- replaced dir /usr/lib/python2.7/site-packages/r2
--- replaced dir /usr/lib/python2.7/site-packages
--- replaced dir /usr/lib/python2.7
Вот начало файла r_core.py:
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _r_core.SWIG_PyInstanceMethod_New(func)
else:
from new import instancemethod as new_instancemethod
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_r_core', [dirname(__file__)])
except ImportError:
import _r_core
return _r_core
if fp is not None:
try:
_mod = imp.load_module('_r_core', fp, pathname, description)
finally:
fp.close()
return _mod
_r_core = swig_import_helper()
del swig_import_helper
else:
import _r_core
del version_info
Вот файл целиком http://paste.pocoo.org/show/545995
Помогите разобраться, в чем дело, и как его заставить работать. С первого взгляда в модуле все нормально, не пойму ошибки.