TALP-UPC / FreeLing

FreeLing project source code
Other
252 stars 96 forks source link

Freeling 4.1 Python3 API using Anaconda 3 (3.7) #89

Closed claudia-rosas closed 4 years ago

claudia-rosas commented 5 years ago

Hello,

I'm trying to install Freeling on my laptop with Linux Mint. Although the basic installation performs well, I cannot achieve to install the Python3 API nor the Java API. I've tried for the Python3, to export the include and library paths to the cmake command, but I'm still obtaining the result of Python.h not found.

This is my cmake line: cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local/freeling/4.1 -DPYTHON3_API=ON -DPYTHON_LIBRARY=$ANACONDA_HOME/lib/libpython3.7m.so -DPYTHON_INCLUDE_DIR=$ANACONDA_HOME/include/python3.7m/ -DPYTHON_EXECUTABLE=$ANACONDA/bin/python

And the error I get when running make or make install is the following:

[ 99%] Built target analyzer
[ 99%] Building CXX object APIs/python3/CMakeFiles/_pyfreeling.dir/freeling_pythonAPIPYTHON_wrap.cxx.o
$HOME/Downloads/FreeLing-4.1/build/APIs/python3/freeling_pythonAPIPYTHON_wrap.cxx:173:21: fatal error: Python.h: No such file or directory
compilation terminated.
APIs/python3/CMakeFiles/_pyfreeling.dir/build.make:71: recipe for target 'APIs/python3/CMakeFiles/_pyfreeling.dir/freeling_pythonAPIPYTHON_wrap.cxx.o' failed
make[2]: *** [APIs/python3/CMakeFiles/_pyfreeling.dir/freeling_pythonAPIPYTHON_wrap.cxx.o] Error 1
CMakeFiles/Makefile2:712: recipe for target 'APIs/python3/CMakeFiles/_pyfreeling.dir/all' failed
make[1]: *** [APIs/python3/CMakeFiles/_pyfreeling.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Have you tried this setup, or I must avoid anaconda and install python from scratch? Best regards, crosasm

lluisp commented 5 years ago

Did you check if the file Python.h is actually in $ANACONDA_HOME/include/python3.7m/ ?? Note that this file is not usually packaged with python. It usually requires the installation of extra packages (e.g. libpython3.7-dev or the like)

claudia-rosas commented 5 years ago

Hi Lluis, Indeed, the Python.h is available in my $ANACONDA_HOME/include/python3.7m/ Have you tried installing Freeling with conda instead of the python installed in the linux distribution? Regards, cr

lluisp commented 5 years ago

No, I haven't. you can run "make VERBOSE=1" so you can see which paths are actually being used by the compiler. That may help you spot the problem.