scrapinghub / python-crfsuite

A python binding for crfsuite
MIT License
770 stars 221 forks source link

Install on windows #20

Closed akbari59 closed 7 years ago

akbari59 commented 9 years ago

I am trying to install python-crfsuite on windows using anaconda but it fails. does anybody have an idea?

the log is as follows:

In file included from c:\mingw\include\wchar.h:617:0,

                 from C:\Users\Mohammad\Anaconda\include/unicodeobje

                 from C:\Users\Mohammad\Anaconda\include/Python.h:85

                 from pycrfsuite/_pycrfsuite.cpp:16:

crfsuite/win32/stdint.h:662:60: error: conflicting declaration 'type

   typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t)  intptr_t

                                                            ^

In file included from C:\Users\Mohammad\Anaconda\include/pyconfig.h:

                 from pycrfsuite/_pycrfsuite.cpp:8:

c:\mingw\include\io.h:41:15: error: 'intptr_t' has a previous declar

   typedef int intptr_t;

               ^

pycrfsuite/_pycrfsuite.cpp: In function 'void __Pyx_RaiseArgtupleInv

pycrfsuite/_pycrfsuite.cpp:11575:59: warning: unknown conversion typ

                  (num_expected == 1) ? "" : "s", num_found);

                                                           ^

pycrfsuite/_pycrfsuite.cpp:11575:59: warning: format '%s' expects ar
 long long int}' [-Wformat=]

pycrfsuite/_pycrfsuite.cpp:11575:59: warning: unknown conversion typ

pycrfsuite/_pycrfsuite.cpp:11575:59: warning: too many arguments for

pycrfsuite/_pycrfsuite.cpp: In function 'void __Pyx_RaiseTooManyValu

pycrfsuite/_pycrfsuite.cpp:12047:94: warning: unknown conversion typ

                  "too many values to unpack (expected %" CYTHON_FOR

pycrfsuite/_pycrfsuite.cpp:12047:94: warning: too many arguments for

pycrfsuite/_pycrfsuite.cpp: In function 'void __Pyx_RaiseNeedMoreVal

pycrfsuite/_pycrfsuite.cpp:12053:48: warning: unknown conversion typ

                  index, (index == 1) ? "" : "s");

                                                ^

pycrfsuite/_pycrfsuite.cpp:12053:48: warning: format '%s' expects ar
 long long int}' [-Wformat=]

pycrfsuite/_pycrfsuite.cpp:12053:48: warning: too many arguments for

error: command 'c:\\MinGW\\bin\\gcc.exe' failed with exit status 1
tpeng commented 9 years ago

seems to me is because the intptr_t is defined in both crfsuite/win32/stdint.h and mingw\include\io.h. https://github.com/tpeng/python-crfsuite/blob/master/setup.py#L25 is the place to add the crfsuite header file on Windows, but since you're compiling with mingw maybe you can try without it.

akbari59 commented 9 years ago

Thanks for your reply. As far as I know, I need to have mingw to compile the code correctly. Indeed, I tried mingw since i wan unable to install it from anaconda tool in windows.

sstugk commented 8 years ago

@akbarimohammad Compilation did work using the Visual Studio 2013 Compiler.

fgregg commented 7 years ago

Will be superseded by #29

kmike commented 7 years ago

@fgregg do you think it should be closed now?

fgregg commented 7 years ago

I think so.