【发布时间】:2018-01-01 01:27:08
【问题描述】:
所以我能够为 python2 安装 sklearn,但由于某种原因,我在为 python3 做同样的事情时遇到了问题。我收到此错误:
Traceback (most recent call last):
File "/home/ajshack_pg/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build # noqa
ImportError: /home/ajshack_pg/sklearn/__check_build/_check_build.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ajshack_pg/sklearn/__init__.py", line 133, in <module>
from . import __check_build
File "/home/ajshack_pg/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/home/ajshack_pg/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: /home/ajshack_pg/sklearn/__check_build/_check_build.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
___________________________________________________________________________
Contents of /home/ajshack_pg/sklearn/__check_build:
setup.py setup.pyc __init__.pyc
_check_build.so __init__.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
我试图进入源目录并输入他们所说的无济于事。这里有什么见解吗?
谢谢!
【问题讨论】:
-
你是如何安装这个包的?您使用的是什么操作系统?
-
@AmosEgel Linux 的外观(.so 文件让我这么认为)。
标签: python python-3.x scikit-learn installation