无法在Google Colab中安装Textract [英] Couldn't install textract in google colab

查看:129
本文介绍了无法在Google Colab中安装Textract的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Google colab中安装textract,错误消息如下所示.

I couldn't install textract in google colab, error message showing as below.

有人建议使用sudo apt-get install libasound2-dev,但是如何在Google colab中使用sudo...?

some people suggest to use sudo apt-get install libasound2-dev but how to do sudo... in google colab?

===错误消息=========================================== ================

=== error message ==========================================================

pocketsphinx的建筑轮子失败运行setup.py clean for pocketsphinx无法构建pocketsphinx安装已收集 程序包:pocketsphinx正在运行setup.py的Pocketsphinx安装... 错误 来自命令/usr/bin/python3 -u -c"import setuptools的完整输出, 标记化; 文件 ='/tmp/pip-install-03c_ysbm/pocketsphinx/setup.py'; f = getattr(标记化,``打开'',打开)(文件) ; code = f.read().replace('\ r \ n', '\ n'); f.close(); exec(compile(code, file ,'exec')))安装 --record/tmp/pip-record-6n9ewg9i/install-record.txt-单一版本-外部管理-编译: 运行安装 运行build_ext 建立'sphinxbase._sphinxbase'扩展 将deps/sphinxbase/swig/sphinxbase.i鞭打到deps/sphinxbase/swig/sphinxbase_wrap.c swig -python-现代-threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i 无法执行"swig":没有这样的文件或目录 错误:命令"swig"失败,退出状态为1

Failed building wheel for pocketsphinx Running setup.py clean for pocketsphinx Failed to build pocketsphinx Installing collected packages: pocketsphinx Running setup.py install for pocketsphinx ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-03c_ysbm/pocketsphinx/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-6n9ewg9i/install-record.txt --single-version-externally-managed --compile: running install running build_ext building 'sphinxbase._sphinxbase' extension swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c swig -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i unable to execute 'swig': No such file or directory error: command 'swig' failed with exit status 1

================================================ =========================== 谢谢, 灵

=========================================================================== Thank you, Ling

推荐答案

不,您不能使用sudo,因为您无法获得colab的root访问权限.

Nope you can't use sudo because you don't get root access for colab.

问题在于您不仅需要libasound2-dev,而且还需要大量软件包.在 https://textract.readthedocs.io/en/stable/installation中检查debian要求. html

The problem is that you don't just need libasound2-dev but a whole host of packages. Check debian requirements in https://textract.readthedocs.io/en/stable/installation.html

此外,为了构建sphinx(textract的要求),您还需要libpulse-dev.这是更新的命令列表.

Also in order to build sphinx (a requirement for textract) you need libpulse-dev. So here is the updated command list.

!apt-get install python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils \
     pstotext tesseract-ocr \
     flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig libasound2-dev libpulse-dev
!pip install git+https://github.com/deanmalmgren/textract

这篇关于无法在Google Colab中安装Textract的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆