Lib Fann2 failed to install

Question:

I would like to install an lib(Fast Artificial Neural Network Library (FANN)) to use in python(version 3.7). But, some exceptions are to stoping the process of the importing. Bellow, is the my command and the exceptions:

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

Exceptions:

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:mypathpip-install-ilv2i8ypfann2

My OS is Windwos 10. Someone can help me? Thanks in advance.

Asked By: Julio Amorim

||

Answers:

Installation from source on Windows:

  • Install Visual C++ Build Tools;
  • Install FANN source code, using cmake;
  • Copy “fanndouble.lib” from FANN installed files to ${python_libs_directory} as “doublefann.lib”;
  • Install swig for Windows (you will need to set an Enviroment Variable for “swig.exe”);
  • Run > python setup.py install from PowerShell/Command Prompt.
Answered By: phd

Download The Fannlib here: 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

Then, install python bindings:

sudo aptitude install pip
sudo pip install fann2

And all will works fine!

Answered By: Julio Amorim

If you came here, as me, with the same error in Windows, a solution is to install a Windows prebuilt package:

pip3 install pipwin
pipwin install fann2

This is equivalent to manually downloading and installing the package from archive https://www.lfd.uci.edu/~gohlke/pythonlibs/

Answered By: luca.vercelli

Does installing fann2 for ubuntu work for you. I am getting this error.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-8w1Q65/fann2/setup.py", line 92, in <module>
    build_swig()
  File "/tmp/pip-install-8w1Q65/fann2/setup.py", line 85, in build_swig
    find_fann()
  File "/tmp/pip-install-8w1Q65/fann2/setup.py", line 73, in find_fann
    raise Exception("Couldn't find FANN source libs!")
Exception: Couldn't find FANN source libs!
Answered By: bungwung
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.