Pycharm et paquetage textreact

Le problème exposé dans ce sujet a été résolu.

Bonjour à tous,

J’ai configuré l’interpréteur utilisé par PyCharm pour que la version 3.5 de Python soit utilisée (donc interpréteur v3.5).

J’aimerais faire usage du package "textreact" (https://textract.readthedocs.io/en/stable/). Donc dans mon terminal, j’ai tapé sudo pip3 install textreact mais j’obtiens cette erreur :

Collecting textreact Could not find a version that satisfies the requirement textreact (from versions: ) No matching distribution found for textreact

Du coup je vais dans PyCharm et je clique sur la bulle d’aide, afin que l’IDE installe lui-même le paquetage (on ne sait jamais) :

deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory

Pourtant, pulseaudio est bien installé dans mon `Ubuntu 16.04̀.

Voici l’erreur en entier, affichée par PyCharm :

Collecting textract Requirement already satisfied (use –upgrade to upgrade): xlrd==1.0.0 in /usr/local/lib/python3.5/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): beautifulsoup4==4.5.3 in /usr/local/lib/python3.5/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): chardet==2.3.0 in /usr/lib/python3/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): SpeechRecognition==3.6.3 in /usr/local/lib/python3.5/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): EbookLib==0.15 in /usr/local/lib/python3.5/dist-packages (from textract) Collecting pocketsphinx==0.1.3 (from textract) Using cached pocketsphinx-0.1.3.zip Requirement already satisfied (use –upgrade to upgrade): python-pptx==0.6.5 in /usr/local/lib/python3.5/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): docx2txt==0.6 in /usr/local/lib/python3.5/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): six==1.10.0 in /usr/lib/python3/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): argcomplete==1.8.2 in /usr/local/lib/python3.5/dist-packages (from textract) Requirement already satisfied (use –upgrade to upgrade): lxml in /usr/lib/python3/dist-packages (from EbookLib==0.15->textract) Requirement already satisfied (use –upgrade to upgrade): XlsxWriter>=0.5.7 in /usr/lib/python3/dist-packages (from python-pptx==0.6.5->textract) Requirement already satisfied (use –upgrade to upgrade): Pillow>=2.6.1 in /usr/lib/python3/dist-packages (from python-pptx==0.6.5->textract) Building wheels for collected packages: pocketsphinx Running setup.py bdist_wheel for pocketsphinx: started Running setup.py bdist_wheel for pocketsphinx: finished with status ’error’ Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;file=’/tmp/pycharm-packaging/pocketsphinx/setup.py’;exec(compile(getattr(tokenize, ’open’, open)(file).read().replace(’\r\n’, ’\n’), file, ’exec’))" bdist_wheel -d /tmp/tmpb8tl0pdspip-wheel- –python-tag cp35: running bdist_wheel running build_ext building ’sphinxbase._ad’ extension swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c swig -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i creating build creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/swig creating build/temp.linux-x86_64-3.5/swig/sphinxbase creating build/temp.linux-x86_64-3.5/deps creating build/temp.linux-x86_64-3.5/deps/sphinxbase creating build/temp.linux-x86_64-3.5/deps/sphinxbase/src creating build/temp.linux-x86_64-3.5/deps/sphinxbase/src/libsphinxad 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 -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.5m -c swig/sphinxbase/ad_wrap.c -o build/temp.linux-x86_64-3.5/swig/sphinxbase/ad_wrap.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation 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 -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.5m -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-x86_64-3.5/deps/sphinxbase/src/libsphinxad/ad_pulse.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory compilation terminated. error: command ’x86_64-linux-gnu-gcc’ failed with exit status 1


Running setup.py clean for pocketsphinx Failed to build pocketsphinx Installing collected packages: pocketsphinx, textract Running setup.py install for pocketsphinx: started Running setup.py install for pocketsphinx: finished with status ’error’ Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;file=’/tmp/pycharm-packaging/pocketsphinx/setup.py’;exec(compile(getattr(tokenize, ’open’, open)(file).read().replace(’\r\n’, ’\n’), file, ’exec’))" install –record /tmp/pip-c1qspq20-record/install-record.txt –single-version-externally-managed –compile: running install running build_ext building ’sphinxbase._ad’ extension swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c swig -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i creating build creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/swig creating build/temp.linux-x86_64-3.5/swig/sphinxbase creating build/temp.linux-x86_64-3.5/deps creating build/temp.linux-x86_64-3.5/deps/sphinxbase creating build/temp.linux-x86_64-3.5/deps/sphinxbase/src creating build/temp.linux-x86_64-3.5/deps/sphinxbase/src/libsphinxad 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 -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.5m -c swig/sphinxbase/ad_wrap.c -o build/temp.linux-x86_64-3.5/swig/sphinxbase/ad_wrap.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation 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 -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.5m -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-x86_64-3.5/deps/sphinxbase/src/libsphinxad/ad_pulse.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory compilation terminated. error: command ’x86_64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------

Failed building wheel for pocketsphinx Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;file=’/tmp/pycharm-packaging/pocketsphinx/setup.py’;exec(compile(getattr(tokenize, ’open’, open)(file).read().replace(’\r\n’, ’\n’), file, ’exec’))" install –record /tmp/pip-c1qspq20-record/install-record.txt –single-version-externally-managed –compile" failed with error code 1 in /tmp/pycharm-packaging/pocketsphinx/ You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the ’pip install –upgrade pip’ command.

Donc voilà pour le moment je ne peux plus continuer mon programme Python parce que je n’arrive pas à installer ce package textreact, c’est assez embarassant…

Quelqu’un a-t-il réussi à utiliser ce paquetage sous Ubuntu >16 svp ? :'(

Merci d’avance les citrons mandarines les clémentines !

Salut,

C’est textract et non textreact :)

Essaye de bien suivre leurs consignes en installant les paquets qu’ils demandent : https://textract.readthedocs.io/en/stable/installation.html

Ah, et c’est très bizarre que tu aie besoin de pulseaudio pour installer ça. Déjà parce que c’est pas dans leurs deps, et ensuite parce que pulseaudio est plutôt un programme destiné à être utilisé directement par les utilisateurs (et non à être utilisé comme une banale bibliothèque).

+0 -0

Oups ! En fait j’ai fait tellement d’essais que je me suis embrouillés.

Dooonc, même avec pip3 install textract, ça ne marche pas. Voici l’erreur (différente) :

deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory compilation terminated. error: command ’x86_64-linux-gnu-gcc’ failed with exit status 1

1
----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file=’/tmp/pip-build-hdu0w48i/pocketsphinx/setup.py’;exec(compile(getattr(tokenize, ’open’, open)(file).read().replace(’\r\n’, ’\n’), file, ’exec’))" install –record /tmp/pip-psg80iym-record/install-record.txt –single-version-externally-managed –compile" failed with error code 1 in /tmp/pip-build-hdu0w48i/pocketsphinx/

J’ai mis en gras la ligne où ça parle de pulseaudio.

Edit : ce problème est résolu ! (https://stackoverflow.com/questions/37931125/installing-pocketsphinx-pulseaudio-development-package ) , le build et l’installation de pocketsphinx a donc été possible !

EDIT : en fait je viens de réussir l’installation de textract (du coup) !

+0 -0
Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte