首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在无root权限的Anaconda虚拟环境中安装全功能幕府?

如何在无root权限的Anaconda虚拟环境中安装全功能幕府?
EN

Stack Overflow用户
提问于 2020-05-18 21:55:28
回答 1查看 253关注 0票数 2

我是一个初学者,在手动安装幕府的过程中遇到了一些问题。

现在的情况是,我要使用幕府的Python接口构建一个MKL-SVM模型,所以我通过conda安装了幕府

代码语言:javascript
复制
conda install shogun

正如你所想象的那样,我看起来很安全、很顺利地安装了它,但是当我在我的项目中调用这个包时,它显示缺少函数shogun.SVMLight()

代码语言:javascript
复制
AttributeError: module 'shogun' has no attribute 'SVRLight'

我搜索了这个错误信息,得到了some advice,但它不工作。因此,我回到了official install manual,有几句话引起了我的注意:

Anaconda packages include most of the optional dependencies, but not all.

Author suggests to compile by hand.

因此,我开始了漫长的旅程,充满了无尽的依赖缺失或不兼容的版本。我的安装步骤如下:

代码语言:javascript
复制
conda create -n shogun python=3.6
conda activate shogun
conda install cmake 
conda install -c creditx gcc-7
# conda install a series of other dependencies

# download source code and GPL license
git clone https://github.com/shogun-toolbox/shogun.git
cd shogun/src
git clone https://github.com/shogun-toolbox/shogun-gpl.git
cp shugun-gpl/* gpl/ -R

cd ..
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/export/home/zhouxiaocheng/miniconda3/envs/shogun -DPYTHON_EXECUTABLE=/export/home/zhouxiaocheng/miniconda3/envs/shogun/bin/python -DPYTHON_INCLUDE_DIR=/export/home/zhouxiaocheng/miniconda3/envs/shogun/include/python3.6m -DPYTHON_LIBRARY=/export/home/zhouxiaocheng/miniconda3/envs/shogun/lib/libpython3.6m.so -DINTERFACE_PYTHON=ON ..

然后,我得到了一些错误提示:

代码语言:javascript
复制
-- Summary of Configuration Variables
-- The following OPTIONAL packages have been found:

 * CCache
 * Doxygen (required version >= 1.8.6)
 * rxcpp
 * spdlog
 * Protobuf
 * HDF5
 * CURL
 * ZLIB
 * BZip2
 * LibLZMA
 * NLopt
 * Ctags
 * Sphinx
 * Pandoc

-- The following REQUIRED packages have been found:

 * SWIG (required version >= 3.0.12)
 * Threads
 * PythonLibs (required version == 3.6.10)
 * NumPy (required version >= 1.7)
 * PythonInterp
 * PLY

-- The following OPTIONAL packages have not been found:

 * OpenMP
 * CxaDemangle
 * Eigen3 (required version >= 3.1.2)
 * ViennaCL (required version >= 1.5.0)
 * TFLogger (required version >= 0.1.0)
 * BLAS
 * GLPK
 * LibArchive
 * CPLEX
 * ARPACK
 * Mosek
 * SNAPPY
 * LZO
 * LpSolve
 * ColPack
 * ARPREC

-- ===================================================================================================================
-- Integrations
--   OpenCV Integration is OFF   enable with -DOpenCV=ON
-- ===================================================================================================================
-- Interfaces
--   Python is ON
--   Octave is OFF               enable with -DINTERFACE_OCTAVE=ON
--   Java is OFF                 enable with -DINTERFACE_JAVA=ON
--   Perl is OFF                 enable with -DINTERFACE_PERL=ON
--   Ruby is OFF                 enable with -DINTERFACE_RUBY=ON
--   C# is OFF                   enable with -DINTERFACE_CSHARP=ON
--   R is OFF                    enable with -DINTERFACE_R=ON
--   Scala is OFF                enable with -DINTERFACE_SCALA=ON
--   CoreML is OFF               enable with -DINTERFACE_COREML=ON
-- ===================================================================================================================
-- To compile shogun type
--   make
-- 
-- To install shogun to /export/home/zhouxiaocheng/miniconda3/envs/shogun type
--   make install
-- 
-- or to install to a custom directory
--   make install DESTDIR=/my/special/path
--   (or rerun cmake with -DCMAKE_INSTALL_PREFIX=/my/special/path) to just change the prefix
-- ===================================================================================================================
-- Configuring done
CMake Warning at src/shogun/CMakeLists.txt:125 (add_library):
  Cannot generate a safe runtime search path for target shogun because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libcurl.so.4] in /export/home/zhouxiaocheng/miniconda3/envs/shogun/lib may be hidden by files in:
      /usr/local/lib
    runtime library [liblzma.so.5] in /export/home/zhouxiaocheng/miniconda3/envs/shogun/lib may be hidden by files in:
      /usr/local/lib

  Some of these libraries may not be found correctly.

我忽略了这些错误信息并执行:

代码语言:javascript
复制
make install

它返回了:

代码语言:javascript
复制
[  0%] Built target ShogunVersionProtobuf
[  1%] Generating version header
[  1%] Built target version
[  1%] Generating /export/home/zhouxiaocheng/software/shogun/build/src/shogun/base/class_list.cpp
[  1%] Built target class_list
[  2%] Built target RapidJSON
[  2%] Built target ChunksProtobuf
[  3%] Built target bitsery
[  3%] Performing install step for 'Eigen3'
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /export/home/zhouxiaocheng/software/shogun/build/src/shogun/third_party/eigen/signature_of_eigen3_matrix_library
CMake Error at cmake_install.cmake:65 (file):
  file cannot create directory: /usr/local/share/eigen3/cmake.  Maybe need
  administrative privileges.


make[3]: *** [install] Error 1
make[2]: *** [Eigen3/src/Eigen3-stamp/Eigen3-install] Error 2
make[1]: *** [src/shogun/CMakeFiles/Eigen3.dir/all] Error 2
make: *** [all] Error 2

我如何解决这个问题,这样我才能成功地调用SVMLight()函数?

已更新

我更改了以前的版本v6.1.3,并再次尝试了该过程。出现了一些不同的错误。

代码语言:javascript
复制
Scanning dependencies of target libshogun
[  2%] Building CXX object src/shogun/CMakeFiles/libshogun.dir/base/Parallel.cpp.o
[  2%] Building CXX object src/shogun/CMakeFiles/libshogun.dir/base/Parameter.cpp.o
[  2%] Building CXX object src/shogun/CMakeFiles/libshogun.dir/base/SGObject.cpp.o
/export/home/zhouxiaocheng/software/shogun-shogun_6.1.3/src/shogun/base/SGObject.cpp:32:10: fatal error: rxcpp/operators/rx-filter.hpp: No such file or directory
 #include <rxcpp/operators/rx-filter.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/shogun/CMakeFiles/libshogun.dir/base/SGObject.cpp.o] Error 1
make[1]: *** [src/shogun/CMakeFiles/libshogun.dir/all] Error 2
make: *** [all] Error 2

同时,我也在the project's Github issue page上提交了一期关于它的文章。这两个问题中的任何一个都有可用的修复方法吗?

EN

回答 1

Stack Overflow用户

发布于 2020-05-21 18:37:43

在贡献者的帮助下,shogun最终被成功编译和安装。如果你在手动编译幕府时遇到任何类似的问题,请参考this

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61871205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档