Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install fann2 using pip #11

Closed
revernus opened this issue May 9, 2015 · 14 comments
Closed

Can't install fann2 using pip #11

revernus opened this issue May 9, 2015 · 14 comments

Comments

@revernus
Copy link

revernus commented May 9, 2015

The version of Python I'm using is 2.7.9 (64 bit) with pip 1.5.6 on Windows 7 powershell. I'm trying to install the package fann2 1.0.7, but I receive an error. Here is the full output:

http://pastebin.com/jXt4PXip

@hazelement
Copy link

Got the same problem. I tried to open the c file with VS 2013 and rebuild. Similar errors show up. It seems that VS 2013 doesn't like the source c code?

@revernus
Copy link
Author

Thanks for your post. I'm not used to VS, coud you please provide some instructions on how I could solve this problem? Thanks in advance!

@FutureLinkOpenSource
Copy link
Contributor

Hey, sorry for not responding sooner. We get a lot of issues opened from Windows users. Could you guys see if one of these:

https://github.com/FutureLinkCorporation/fann2/issues?q=is%3Aissue+is%3Aclosed

helps solve the problem?

@hazelement
Copy link

It seems we are getting c compiling errors during the installation. I've checked others response. They seem to have different issues...

Here is the log:


C:\Python27\Scripts\pip-script.py run on 05/23/15 13:25:13
Downloading/unpacking fann2
Getting page https://pypi.python.org/simple/fann2/
URLs to search for versions for fann2:

'\n'), file, 'exec'))" install --record c:\users\harry\appdata\local\temp\pip-z9qfpq-record\install-record.txt --single-version-externally-managed --compile
running swig
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\fann2
copying fann2__init__.py -> build\lib.win32-2.7\fann2
copying fann2\libfann.py -> build\lib.win32-2.7\fann2
running egg_info
writing fann2.egg-info\PKG-INFO
writing top-level names to fann2.egg-info\top_level.txt
writing dependency_links to fann2.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'fann2.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'fann2.egg-info\SOURCES.txt'
copying fann2\fann2.i -> build\lib.win32-2.7\fann2
copying fann2\fann2_wrap.cxx -> build\lib.win32-2.7\fann2
copying fann2\fann_cpp_subclass.h -> build\lib.win32-2.7\fann2
running build_ext
building 'fann2._libfann' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\fann2
C:\Users\Harry\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSWIG_COMPILE -I./include -I../include -Iinclude -IC:\Python27\include -IC:\Python27\PC 

/Tpfann2/fann2_wrap.cxx /Fobuild\temp.win32-2.7\Release\fann2/fann2_wrap.obj
fann2_wrap.cxx
C:\Users\Harry\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
./include\fann_cpp.h(958) : error C2057: expected constant expression
./include\fann_cpp.h(958) : error C2466: cannot allocate an array of constant size 0
./include\fann_cpp.h(958) : error C2133: 'arr' : unknown size
./include\fann_cpp.h(1011) : error C2057: expected constant expression
./include\fann_cpp.h(1011) : error C2466: cannot allocate an array of constant size 0
./include\fann_cpp.h(1011) : error C2133: 'arr' : unknown size
./include\fann_cpp.h(1061) : error C2057: expected constant expression
./include\fann_cpp.h(1061) : error C2466: cannot allocate an array of constant size 0
./include\fann_cpp.h(1061) : error C2133: 'arr' : unknown size
fann2/fann2_wrap.cxx(5063) : error C2664: 'FANN::training_data::create_train_from_callback' : cannot convert parameter 4 from 'void (__cdecl *)(unsigned int,unsigned int,unsigned int,fann_type *,fann_type *)' to 'void (__stdcall *)

(unsigned int,unsigned int,unsigned int,fann_type *,fann_type *)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error: command 'C:\Users\Harry\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
Complete output from command C:\Python27\python.exe -c "import setuptools, tokenize;file='c:\users\harry\appdata\local\temp\pip_build_Harry\fann2\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read

().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\harry\appdata\local\temp\pip-z9qfpq-record\install-record.txt --single-version-externally-managed --compile:
running swig

running install

running build

running build_py

creating build

creating build\lib.win32-2.7

creating build\lib.win32-2.7\fann2

copying fann2__init__.py -> build\lib.win32-2.7\fann2

copying fann2\libfann.py -> build\lib.win32-2.7\fann2

running egg_info

writing fann2.egg-info\PKG-INFO

writing top-level names to fann2.egg-info\top_level.txt

writing dependency_links to fann2.egg-info\dependency_links.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'fann2.egg-info\SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'fann2.egg-info\SOURCES.txt'

copying fann2\fann2.i -> build\lib.win32-2.7\fann2

copying fann2\fann2_wrap.cxx -> build\lib.win32-2.7\fann2

copying fann2\fann_cpp_subclass.h -> build\lib.win32-2.7\fann2

running build_ext

building 'fann2._libfann' extension

creating build\temp.win32-2.7

creating build\temp.win32-2.7\Release

creating build\temp.win32-2.7\Release\fann2

C:\Users\Harry\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSWIG_COMPILE -I./include -I../include -Iinclude -IC:\Python27\include -IC:\Python27\PC

/Tpfann2/fann2_wrap.cxx /Fobuild\temp.win32-2.7\Release\fann2/fann2_wrap.obj

fann2_wrap.cxx

C:\Users\Harry\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

./include\fann_cpp.h(958) : error C2057: expected constant expression

./include\fann_cpp.h(958) : error C2466: cannot allocate an array of constant size 0

./include\fann_cpp.h(958) : error C2133: 'arr' : unknown size

./include\fann_cpp.h(1011) : error C2057: expected constant expression

./include\fann_cpp.h(1011) : error C2466: cannot allocate an array of constant size 0

./include\fann_cpp.h(1011) : error C2133: 'arr' : unknown size

./include\fann_cpp.h(1061) : error C2057: expected constant expression

./include\fann_cpp.h(1061) : error C2466: cannot allocate an array of constant size 0

./include\fann_cpp.h(1061) : error C2133: 'arr' : unknown size

fann2/fann2_wrap.cxx(5063) : error C2664: 'FANN::training_data::create_train_from_callback' : cannot convert parameter 4 from 'void (__cdecl *)(unsigned int,unsigned int,unsigned int,fann_type *,fann_type *)' to 'void (__stdcall *)

(unsigned int,unsigned int,unsigned int,fann_type *,fann_type *)'

    This conversion requires a reinterpret_cast, a C-style cast or function-style cast

error: command 'C:\Users\Harry\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2


Cleaning up...
Removing temporary dir c:\users\harry\appdata\local\temp\pip_build_Harry...
Command C:\Python27\python.exe -c "import setuptools, tokenize;file='c:\users\harry\appdata\local\temp\pip_build_Harry\fann2\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'),

file, 'exec'))" install --record c:\users\harry\appdata\local\temp\pip-z9qfpq-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\harry\appdata\local\temp\pip_build_Harry

\fann2
Exception information:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 284, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "C:\Python27\lib\site-packages\pip\req.py", line 1450, in install
requirement.install(install_options, global_options, _args, *_kwargs)
File "C:\Python27\lib\site-packages\pip\req.py", line 721, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "C:\Python27\lib\site-packages\pip\util.py", line 700, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Python27\python.exe -c "import setuptools, tokenize;file='c:\users\harry\appdata\local\temp\pip_build_Harry\fann2\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace

('\r\n', '\n'), file, 'exec'))" install --record c:\users\harry\appdata\local\temp\pip-z9qfpq-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\harry\appdata\local\t

@tty02-fl
Copy link
Contributor

Se how this user solve the problem: #9 (comment)

Here you will find how install properly the fann libs http://leenissen.dk/fann/wp/help/installing-fann/

Anyway if you find hard the installation you can use a web site that has a working binary of python fann2 v1.07
http://www.lfd.uci.edu/~gohlke/pythonlibs/#fann2

@hazelement
Copy link

thanks man. I'll give #9 a shot again and try that binary as well. hopefully they will work~

@revernus
Copy link
Author

#9 didn't work for me (maybe because I don't know exactly what I'm doing in VS). But I managed to solve the problem by installing the *.whl file available in http://www.lfd.uci.edu/~gohlke/pythonlibs/#fann2

First I installed wheel:

pip install wheel

Then I installed the file "fann2‑1.0.7‑cp27‑none‑win32.whl" that I downloaded:

pip install c:\path\to\file\fann2‑1.0.7‑cp27‑none‑win32.whl

Now fann2 is working, it seems. Please fix this bug. And thanks for your attention!

@hazelement
Copy link

hey guys! sorry came back too late. I've got it working with Revernus's method! Though I didn't install wheel. went straight ahead for the whl file. Cheers! Thanks guys.

@houssainy
Copy link

I was facing the same problem and it have been solved by using Revernus method also.

Thank you Revernus!

@revernus
Copy link
Author

I'm glad it helped you, guys. I hope developers fix this bug soon, FANN is a great library.

@FutureLinkOpenSource
Copy link
Contributor

We don't build, test, and deploy on Windows; though, when there's time, I'd like to look into that build error posted. It seems easy enough to fix. Resorting to unsigned third-party binaries isn't an ideal solution for users of this package. I'll see if I can get my Windows machine ready to test this and have something sorted by the end of next month.

@Byreviero
Copy link

I have got the same problem, like FiniteElementries. http://pastebin.com/Tjf6MCdi
I think, the problem is in invalid cast at generated fann2_wrap.cxx by swig.
In addition, it swears on its includes. If I replaced these by includes from FANN-2.2.0-Source, such errors no longer occur.
Used swigwin-3.0.7

@magiclevinho
Copy link

Is there a solution to install fann2 from pip? None of the above mentioned solutions worked for me. :(

@johanvandegriff
Copy link

@magiclevinho See this issue: #25
I ended up cloning and installing this fork that has a fix: https://github.com/randomstuff/fann2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants