2017-08-08 37 views
0

我在Mac上。步驟1:如何安裝Shogun的Python界面?

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.*),我遵循的指示here,並設置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 

回答

0

這裏的問題是可能是將軍的文檔是目前用於開發中的6.1版,但conda軟件包是最新的實際版本6.0。在6.0中,你需要做from modshogun import RealFeatures; shogun包是舊界面,而現代的「模塊化」包是modshogun。這將在即將發佈的6.1版本中重新命名爲shogun