在成功安装/lilluminaThirdparty/python/python-2.7/bin/pip2.7install-U scikit后,我在启动回归分析时遇到了问题。from sklearn import linear_model
给出
File "/illumina/thirdparty/python/python-2.7.5/lib/python2.7/site-packages/sklearn/linear_model/__init__.py", line 25, in <module>
from .logistic import (LogisticRegression, LogisticRegressionCV,
File "/illumina/thirdparty/python/python-2.7.5/lib/python2.7/site-packages/sklearn/linear_model/logistic.py", line 23, in <module>
from ..svm.base import _fit_liblinear
File "/illumina/thirdparty/python/python-2.7.5/lib/python2.7/site-packages/sklearn/svm/__init__.py", line 13, in <module>
from .classes import SVC, NuSVC, SVR, NuSVR, OneClassSVM, LinearSVC,
File "/illumina/thirdparty/python/python-2.7.5/lib/python2.7/site-packages/sklearn/svm/classes.py", line 4, in <module>
from .base import _fit_liblinear, BaseSVC, BaseLibSVM
File "/illumina/thirdparty/python/python-2.7.5/lib/python2.7/site-packages/sklearn/svm/base.py", line 8, in <module>
from . import libsvm, liblinear
ImportError: /illumina/thirdparty/python/python-2.7.5/lib/python2.7/site-packages/sklearn/svm/libsvm.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_inf
问题似乎出在libsvm上,因为from sklearn import datasets
运行良好。
任何建议都将不胜感激。
环境:
- Python 2.7.5
- GCC 4.1.2 20080704(Red Hat 4.1.2-44)
- scipy 0.16.0
- 编号1.9.1
这显然是ABI不匹配。您可能会不由自主地使用一个python模块,该模块链接到本机库,而本机库应该是不同版本的。确保在运行python时,系统只能找到一个libsvm。
- 请先尝试卸载sklearn
apt-get-remove-sklearn - 删除在packages文件夹中创建的以前的sklearn目录
- 再次安装
apt-get-Install-python-sklearn