Issue in installing ujson in ubuntu - python

I am trying to install ujson which is required dependency for the installation of RASA. The command I triggered is follows:
sudo pip3 install ujson
And got the following error message.
WARNING: The directory '/home/kamaldeep/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ujson
Downloading ujson-1.35.tar.gz (192 kB)
|████████████████████████████████| 192 kB 217 kB/s
Building wheels for collected packages: ujson
Building wheel for ujson (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"'; _file__='"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, _file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-918warx5
cwd: /tmp/pip-install-uo5b9gzb/ujson/
Complete output (14 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running bdist_wheel
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/python
creating build/temp.linux-x86_64-3.7/lib
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 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./python -I./lib -I/usr/include/python3.7m -c ./python/ujson.c -o build/temp.linux-x86_64-3.7/./python/ujson.o -D_GNU_SOURCE
In file included from ./python/ujson.c:39:0:
./python/py_defines.h:39:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for ujson
Running setup.py clean for ujson
Failed to build ujson
Installing collected packages: ujson
Running setup.py install for ujson ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"'; _file__='"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, _file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-c2p8ewru/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/ujson
cwd: /tmp/pip-install-uo5b9gzb/ujson/
Complete output (14 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running install
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/python
creating build/temp.linux-x86_64-3.7/lib
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 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./python -I./lib -I/usr/include/python3.7m -c ./python/ujson.c -o build/temp.linux-x86_64-3.7/./python/ujson.o -D_GNU_SOURCE
In file included from ./python/ujson.c:39:0:
./python/py_defines.h:39:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"'; _file__='"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, _file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-c2p8ewru/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/ujson Check the logs for full command output.
enter image description here
Please let me know the resolution. Thanks in advance.

You need to install the python developer package, since your are building the module from source.
sudo aptitude install python-dev

It’s Super Easy!
sudo apt-get update
sudo apt-get install python3-ujson

Related

Unable to install pyaudio on Ubuntu 21.04? [duplicate]

This question already has answers here:
fatal error: Python.h: No such file or directory
(35 answers)
Closed 1 year ago.
Within a python venv via terminal I have tried to install pyaudio using pip install pyaudio. I continue to get the following error:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /home/user/Documents/Dev/jarvis/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-mnx7j3d4/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/Documents/Dev/jarvis/venv/include/site/python3.9/pyaudio
cwd: /tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
copying src/pyaudio.py -> build/lib.linux-x86_64-3.9
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-1n6GrT/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-1n6GrT/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/user/Documents/Dev/jarvis/venv/include -I/usr/include/python3.9 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:28:10: fatal error: Python.h: No such file or directory
28 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/Documents/Dev/jarvis/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-mnx7j3d4/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/Documents/Dev/jarvis/venv/include/site/python3.9/pyaudio Check the logs for full command output.
Try pip install wheel in your terminal and try installing pyaudio again

Cant install PyAudio python3.8

I have kali linux, amd64, last python3.8 version, and when i am trying to install pyaudio i get just this ERROR: Failed building wheel for PyAudio Running setup.py clean for PyAudio Failed to build PyAudio Installing collected packages: PyAudio Running setup.py install for PyAudio ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l87_4qp_/PyAudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l87_4qp_/PyAudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2u86ewfj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/PyAudio cwd: /tmp/pip-install-l87_4qp_/PyAudio/ Complete output (16 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.8 copying src/pyaudio.py -> build/lib.linux-x86_64-3.8 running build_ext building '_portaudio' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/src 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/usr/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.8/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: portaudio.h: Нет такого файла или каталога 29 | #include "portaudio.h" | ^~~~~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l87_4qp_/PyAudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l87_4qp_/PyAudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2u86ewfj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/PyAudio Check the logs for full command output
Idk what to do with that
I solved it by installing portaudio19-dev

i cant install pyaudio, a weird error is showing up?

i used command pip3 install pyaudio,this error shows up
btw, im using ubuntu 20.04
i was using speech recogniser module in python but this error shows up
and im using visual studio code
any thoughts?
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2f7g2sg2/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2f7g2sg2/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ut55o31r
cwd: /tmp/pip-install-2f7g2sg2/pyaudio/
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
copying src/pyaudio.py -> build/lib.linux-x86_64-3.8
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
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/usr/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.8/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory
29 | #include "portaudio.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2f7g2sg2/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2f7g2sg2/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lr0qj7xe/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/vedarsh/.local/include/python3.8/pyaudio
cwd: /tmp/pip-install-2f7g2sg2/pyaudio/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
copying src/pyaudio.py -> build/lib.linux-x86_64-3.8
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
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/usr/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.8/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory
29 | #include "portaudio.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2f7g2sg2/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2f7g2sg2/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lr0qj7xe/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/vedarsh/.local/include/python3.8/pyaudio Check the logs for full command output.
any answers?
Run this command and your problem will be fixed
pip install pyaudio -> error
sudo apt-get install portaudio19-dev -> success
pip install pyaudio -> success
There are a few more dependencies which have to be manually installed before using python's pyaudio.
Execute these commands and you must be fine:
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
sudo apt-get install ffmpeg libav-tools
sudo pip install pyaudio
You might also refer to this GitHub Gist.

Issues trying to use mmh3 in jupiter notebook

I'm trying to use import and use mmh3 for hashing however I get errors when I try to do so.
These are the error i get:
Collecting mmh3
Using cached mmh3-2.5.1.tar.gz (9.8 kB)
Building wheels for collected packages: mmh3*emphasized text*
Building wheel for mmh3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /PYSPARK-ENV/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"'; file='"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vr4gj2gj
cwd: /tmp/pip-install-6vdrtr2d/mmh3/
Complete output (9 lines):
running bdist_wheel
running build
running build_ext
building 'mmh3' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c mmh3module.cpp -o build/temp.linux-x86_64-3.6/mmh3module.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
ERROR: Failed building wheel for mmh3
Running setup.py clean for mmh3
Failed to build mmh3
Installing collected packages: mmh3
Running setup.py install for mmh3 ... error
ERROR: Command errored out with exit status 1:
command: /PYSPARK-ENV/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"'; file='"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-rvdzd4bs/install-record.txt --single-version-externally-managed --compile --install-headers /PYSPARK-ENV/include/site/python3.6/mmh3
cwd: /tmp/pip-install-6vdrtr2d/mmh3/
Complete output (9 lines):
running install
running build
running build_ext
building 'mmh3' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c mmh3module.cpp -o build/temp.linux-x86_64-3.6/mmh3module.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /PYSPARK-ENV/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"'; file='"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-rvdzd4bs/install-record.txt --single-version-externally-managed --compile --install-headers /PYSPARK-ENV/include/site/python3.6/mmh3 Check the logs for full command output.
Note: you may need to restart the kernel to use updated packages.
Then if I try and just import it, it will say mmh3 not found
Even though it all works on my local machine
Any help would be greatly appreciated.

How can I use textcat with Python?

I would like to give TextCat a try. It would be most convenient for me if I could run it from Python, as I would like to see how well it does on a private dataset.
I gave languagedet, but according to
from languagedet.mixed import MixedDetector
det = MixedDetector()
print(det.available)
much less than the 69 languages claimed on TextCats website are available via languagedet.
I also tried pylibtextcat, but I get:
Collecting pylibtextcat
Using cached pylibtextcat-0.2.tar.bz2
Building wheels for collected packages: pylibtextcat
Running setup.py bdist_wheel for pylibtextcat ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dkslney/pylibtextcat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpyct9pyfepip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_ext
building 'textcat' extension
creating build
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="0.2" -I/usr/include/python3.5m -c libtextcat.c -o build/temp.linux-x86_64-3.5/libtextcat.o -Wall -Wextra
libtextcat.c:7:32: fatal error: libtextcat/textcat.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pylibtextcat
Running setup.py clean for pylibtextcat
Failed to build pylibtextcat
Installing collected packages: pylibtextcat
Running setup.py install for pylibtextcat ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dkslney/pylibtextcat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lwxglu50-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'textcat' extension
creating build
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="0.2" -I/usr/include/python3.5m -c libtextcat.c -o build/temp.linux-x86_64-3.5/libtextcat.o -Wall -Wextra
libtextcat.c:7:32: fatal error: libtextcat/textcat.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dkslney/pylibtextcat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lwxglu50-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1dkslney/pylibtextcat/
when I try to install it (and I have libexttextcat-2.0-0, libexttextcat-data, libexttextcat-dev installed).
Can I use TextCat with Python?
Seems not to be the same, but nltk has:
from nltk.classify import textcat
text = "This is a simple example."
cls = textcat.TextCat()
distances = cls.lang_dists(text) # a dict of 437 elements
cls.guess_language(text) # a str

Categories