未定义的符号:PyUnicodeUCS4_AsWideChar

时间:2014-11-05 22:47:03

标签: python python-2.7

我通过运行

成功编译了Caffe框架(caffe.berkeleyvision.org)
make all
make pycaffe

但是,当我尝试加载库时,我遇到了一个奇怪的错误:

In [1]: import sys

In [2]: sys.path.append('/contrib/projects/caffe/caffe/python')

In [3]: import caffe
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-1cca3aa1f8c5> in <module>()
----> 1 import caffe

/contrib/projects/caffe/caffe/python/caffe/__init__.py in <module>()
----> 1 from .pycaffe import Net, SGDSolver
      2 from .classifier import Classifier
      3 from .detector import Detector
      4 import io

/contrib/projects/caffe/caffe/python/caffe/pycaffe.py in <module>()
      8 import numpy as np
      9 
---> 10 from ._caffe import Net, SGDSolver
     11 import caffe.io
     12 

ImportError: /usr/lib/libboost_python-py27.so.1.49.0: undefined symbol: PyUnicodeUCS4_AsWideChar

我是否需要使用某些标志重新编译我的python发行版?

1 个答案:

答案 0 :(得分:0)

您正在尝试使用UCS2 Python运行为UCS4(广泛的Unicode)构建编译的扩展。

重新编译扩展或安装UCS4 Python构建。见How to change python from UCS2 to UCS4