0

我在 Mac 上。步骤1:

sudo conda install -c conda-forge shogun

第2步:

$ python
Python 2.7.12 |Anaconda custom (x86_64)| (default, Jul  2 2016, 17:43:17)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import shogun
>>> from shogun import RealFeatures, PolyKernel, CSVFile
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name RealFeatures

我还使用 RPM 在 Fedora 上进行了尝试。在验证 C++ 接口是否正常工作 ( gcc shogun.cpp -I/usr/include/shogun/base -lshogun -L/usr/lib64/libshogun.*) 之后,我按照此处的说明进行了设置PYTHONPATH=/usr/lib64/python2.7/site-packages/modshogun.py

接着:

$ python
Python 2.7.13 (default, May 10 2017, 20:04:36)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import shogun
>>> from shogun import RealFeatures, PolyKernel, CSVFile
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name RealFeatures
4

1 回答 1

0

这里的问题可能是 shogun 的文档目前适用于开发中的 6.1 版本,但 conda 包适用于最新的实际版本 6.0。在 6.0 中,您需要执行from modshogun import RealFeatures; 包是shogun旧接口,现代“模块化”接口是modshogun. 这将shogun在即将发布的 6.1 版本中重命名。

于 2017-08-23T00:34:40.263 回答