0

The module cffi-1.7.0 and python-magic-5.11 should be installed normally, but when executing the python-magic built-in example.py, it failed!

Now we just wonder the following two questions:
1) Why and how the relative directory path with "build/bdist.linux-x86_64/egg/magic" came since it was temporary during its installation ?
2) Why and how the cffi pycache share library file would be imported from its absolute installation source directory path at the last line ?

# 
# 
# /usr/share/doc/python-magic-5.11/example.py
build/bdist.linux-x86_64/egg/magic/__pycache__/_cffi__x14a33f6ax54cebdac.c: In function '_cffi_f_magic_version':
build/bdist.linux-x86_64/egg/magic/__pycache__/_cffi__x14a33f6ax54cebdac.c:711:3: warning: implicit declaration of function 'magic_version' [-Wimplicit-function-declaration]
   { result = magic_version(); }
   ^
Traceback (most recent call last):
  File "/usr/share/doc/python-magic-5.11/example.py", line 3, in <module>
    import magic
  File "build/bdist.linux-x86_64/egg/magic/__init__.py", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/magic/ffi.py", line 27, in <module>
  File "/usr/lib64/python2.7/site-packages/cffi-1.7.0-py2.7-linux-x86_64.egg/cffi/api.py", line 437, in verify
    lib = self.verifier.load_library()
  File "/usr/lib64/python2.7/site-packages/cffi-1.7.0-py2.7-linux-x86_64.egg/cffi/verifier.py", line 114, in load_library
    return self._load_library()
  File "/usr/lib64/python2.7/site-packages/cffi-1.7.0-py2.7-linux-x86_64.egg/cffi/verifier.py", line 225, in _load_library
    return self._vengine.load_library()
  File "/usr/lib64/python2.7/site-packages/cffi-1.7.0-py2.7-linux-x86_64.egg/cffi/vengine_cpy.py", line 158, in load_library
    raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing '/install/cffi/cffi-1.7.0/build/bdist.linux-x86_64/egg/magic/__pycache__/_cffi__x14a33f6ax54cebdac.so': /install/cffi/cffi-1.7.0/build/bdist.linux-x86_64/egg/magic/__pycache__/_cffi__x14a33f6ax54cebdac.so: undefined symbol: magic_version
# 
# 
#

Other details (including the installation record of the cffi module):

# 
# 
# python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to cffi.egg-info/requires.txt
writing cffi.egg-info/PKG-INFO
writing top-level names to cffi.egg-info/top_level.txt
writing dependency_links to cffi.egg-info/dependency_links.txt
writing entry points to cffi.egg-info/entry_points.txt
reading manifest file 'cffi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'cffi.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/vengine_cpy.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/model.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/commontypes.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/backend_ctypes.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/cparser.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/ffiplatform.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/vengine_gen.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/api.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/lock.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/__init__.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/setuptools_ext.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/cffi_opcode.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/verifier.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/recompiler.py -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/_cffi_include.h -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/parse_c_type.h -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/cffi/_embedding.h -> build/bdist.linux-x86_64/egg/cffi
copying build/lib.linux-x86_64-2.7/_cffi_backend.so -> build/bdist.linux-x86_64/egg
byte-compiling build/bdist.linux-x86_64/egg/cffi/vengine_cpy.py to vengine_cpy.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/model.py to model.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/commontypes.py to commontypes.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/backend_ctypes.py to backend_ctypes.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/cparser.py to cparser.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/ffiplatform.py to ffiplatform.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/vengine_gen.py to vengine_gen.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/api.py to api.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/lock.py to lock.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/setuptools_ext.py to setuptools_ext.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/cffi_opcode.py to cffi_opcode.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/verifier.py to verifier.pyc
byte-compiling build/bdist.linux-x86_64/egg/cffi/recompiler.py to recompiler.pyc
creating stub loader for _cffi_backend.so
byte-compiling build/bdist.linux-x86_64/egg/_cffi_backend.py to _cffi_backend.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying cffi.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
creating 'dist/cffi-1.7.0-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing cffi-1.7.0-py2.7-linux-x86_64.egg
creating /usr/lib64/python2.7/site-packages/cffi-1.7.0-py2.7-linux-x86_64.egg
Extracting cffi-1.7.0-py2.7-linux-x86_64.egg to /usr/lib64/python2.7/site-packages
Adding cffi 1.7.0 to easy-install.pth file

Installed /usr/lib64/python2.7/site-packages/cffi-1.7.0-py2.7-linux-x86_64.egg
Processing dependencies for cffi==1.7.0
Searching for pycparser==2.14
Best match: pycparser 2.14
Adding pycparser 2.14 to easy-install.pth file

Using /usr/lib/python2.7/site-packages
Finished processing dependencies for cffi==1.7.0
# 
# 
#
# 
# rpm -qa|grep -i pytho|grep -i magic
python-magic-5.11-35.el7.noarch
# 
# 
# 
# rpm -V python-magic-5.11-35.el7.noarch
# 
# 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.