我正尝试在Centos 6.7
上使用Anaconda Python 2.7
按照these的说明安装mutalyzer 2.0.14。Mutalyzer py.test以python-magic错误失败
我的安装很好,但是当我尝试运行py.test
套件时,我遇到了一系列失败。
我怀疑操作系统版本libmagic
和python2.7包python-magic
之间存在版本冲突。
如果有人能够解释这里发生了什么或者更好地解决这个问题,我会非常感兴趣。
我libmagic安装:
$ rpm -qa | grep 'file-'
file-libs-5.04-21.el6.x86_64
file-5.04-21.el6.x86_64
file-devel-5.04-21.el6.x86_64
通讯Python包:
$ source activate py27
discarding /opt/anaconda2/bin from PATH
prepending /opt/anaconda2/envs/py27/bin to PATH
(py27) $ pip list | grep magic
Magic-file-extensions (0.2, /home/chris.guest/temp/mutalyzer/src/magic-file-extensions)
python-magic (0.4.10)
py.test是这样开始的:
# py.test
======================================================= test session starts =======================================================
platform linux2 -- Python 2.7.11, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /home/chris.guest/temp/mutalyzer, inifile:
collected 610 items/3 errors
tests/test_backtranslator.py ......
tests/test_base.py .
tests/test_crossmap.py .......................
tests/test_grammar.py ........................................................................................
tests/test_mapping.py ..............................
tests/test_migrations.py .
tests/test_mutator.py ................................................................................................................................................................
tests/test_ncbi.py ............................................................................................................
tests/test_parsers_genbank.py ..........
而且有很多错误的结束。许多测试,因为undefined symbol: magic_list
失败:
_________________________________________ ERROR at setup of test_batch_unicode[sqlite://] _________________________________________
@pytest.fixture
def website():
> return create_app().test_client()
tests/test_website.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mutalyzer/website/__init__.py:35: in create_app
from mutalyzer.website.views import website
mutalyzer/website/views.py:26: in <module>
from mutalyzer import (announce, backtranslator, File, Retriever, Scheduler,
mutalyzer/File.py:23: in <module>
import magic # open(), MAGIC_MIME, MAGIC_NONE
src/magic-file-extensions/magic.py:94: in <module>
_list = _libraries['magic'].magic_list
/opt/anaconda2/envs/py27/lib/python2.7/ctypes/__init__.py:378: in __getattr__
func = self.__getitem__(name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CDLL 'libmagic.so.1', handle 160cc50 at 7f23b97340d0>, name_or_ordinal = 'magic_list'
def __getitem__(self, name_or_ordinal):
> func = self._FuncPtr((name_or_ordinal, self))
E AttributeError: /usr/lib64/libmagic.so.1: undefined symbol: magic_list
/opt/anaconda2/envs/py27/lib/python2.7/ctypes/__init__.py:383: AttributeError
______________________________________ ERROR at setup of test_batch_unicode_email[sqlite://] ______________________________________
@pytest.fixture
def website():
> return create_app().test_client()
tests/test_website.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mutalyzer/website/__init__.py:35: in create_app
from mutalyzer.website.views import website
mutalyzer/website/views.py:26: in <module>
from mutalyzer import (announce, backtranslator, File, Retriever, Scheduler,
mutalyzer/File.py:23: in <module>
import magic # open(), MAGIC_MIME, MAGIC_NONE
src/magic-file-extensions/magic.py:94: in <module>
_list = _libraries['magic'].magic_list
/opt/anaconda2/envs/py27/lib/python2.7/ctypes/__init__.py:378: in __getattr__
func = self.__getitem__(name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CDLL 'libmagic.so.1', handle 160cc50 at 7f23b984ef50>, name_or_ordinal = 'magic_list'
def __getitem__(self, name_or_ordinal):
> func = self._FuncPtr((name_or_ordinal, self))
E AttributeError: /usr/lib64/libmagic.so.1: undefined symbol: magic_list
/opt/anaconda2/envs/py27/lib/python2.7/ctypes/__init__.py:383: AttributeError
============================================== 548 passed, 65 error in 41.42 seconds ==============================================
(py27)[[email protected] mutalyzer]#
@MartijnVermaat如果您认为它会有帮助,请随时将此补丁添加到'mutalyzer'代码库。 – ChrisGuest