libindic / indic-trans

The project aims on adding a state-of-the-art transliteration module for cross transliterations among all Indian languages including English.
GNU Affero General Public License v3.0
256 stars 61 forks source link

SOLVED: x86_64-linux-gnu-gcc errors during installation #51

Closed ymoslem closed 3 years ago

ymoslem commented 3 years ago

OS: Ubuntu 18.04 Python: 3.7 Virtualenv: 15.1.0

• Python.h: No such file or directory

copying indictrans/trunk/tests/hin2rom.tnt -> build/lib.linux-x86_64-3.7/indictrans/trunk/tests
running build_ext
building 'indictrans._decode.beamsearch' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/indictrans
creating build/temp.linux-x86_64-3.7/indictrans/_decode
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/username/.local/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c indictrans/_decode/beamsearch.c -o build/temp.linux-x86_64-3.7/indictrans/_decode/beamsearch.o
indictrans/_decode/beamsearch.c:36:10: fatal error: Python.h: No such file or directory
 #include "Python.h"
          ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Solution

sudo apt-get install python3.7-dev

Change "3.7" with your Python version.

Source

• could not create '/usr/lib/python3.7/site-packages': Permission denied

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.7/indictrans/_utils/sparseadd.o -o build/lib.linux-x86_64-3.7/indictrans/_utils/sparseadd.cpython-37m-x86_64-linux-gnu.so
running install_lib
creating /usr/lib/python3.7/site-packages
error: could not create '/usr/lib/python3.7/site-packages': Permission denied

Solution

Add --user to the installation command.

python3 setup.py install --user