Lib Fann2 安装失败

Lib Fann2 failed to install

我想安装一个库(快速人工神经网络库 (FANN))以在 python(版本 3.7)中使用。但是,有些例外情况是停止导入过程。下面是我的命令和例外情况:

命令:pip install fann2 (as the As the pypi .org is showing)

例外情况:

Collecting fann2 Using cached https://files.pythonhosted.org/packages/80/a1/fed455d25c34a62d4625254880f052502a49461a5dd1b80854387ae2b25f/fann2-1.1.2.tar.gz

Complete output from command python setup.py egg_info: Looking for FANN libs...

Traceback (most recent call last): File "", line 1, in

line 92, in build_swig()

line 85, in build_swig find_fann()

line 66, in find_fann raise Exception("Couldn't find FANN source libs!") Exception: Couldn't find FANN source libs!

Command "python setup.py egg_info" failed with error code 1 in C:\mypath\pip-install-ilv2i8yp\fann2\

我的OS是Windwos 10,谁能帮帮我?提前致谢。

Installation from source on Windows:

  • 安装 Visual C++ 构建工具;
  • 安装 FANN source code,使用 cmake;
  • 将 "fanndouble.lib" 从 FANN 安装文件复制到 ${python_libs_directory} 为 "doublefann.lib";
  • 为 Windows 安装 swig(您需要为 "swig.exe" 设置环境变量);
  • 运行 > python setup.py 从 PowerShell/Command 提示安装。

在此处下载 Fannlib:Click Here

wget http://downloads.sourceforge.net/project/fann/fann/2.2.0/FANN-2.2.0-Source.zip

unzip FANN-2.2.0-Source.zip
cd FANN-2.2.0-Source/
cmake .
sudo make install

sudo aptitude install swig

然后,安装 python 绑定:

sudo aptitude install pip
sudo pip install fann2

一切都会好起来的!

如果你像我一样来到这里,在 Windows 中遇到同样的错误,解决方案是安装 Windows 预构建包:

pip3 install pipwin
pipwin install fann2

这相当于从存档中手动下载并安装包 https://www.lfd.uci.edu/~gohlke/pythonlibs/