简体   繁体   English

无法在google colab中安装textract

[英]Couldn't install textract in google colab

I couldn't install textract in google colab, error message showing as below. 我无法在google colab中安装textract ,错误消息如下所示。

some people suggest to use sudo apt-get install libasound2-dev but how to do sudo... in google colab? 有人建议使用sudo apt-get install libasound2-dev但是如何在google colab中做sudo...

=== error message ========================================================== ===错误信息============================================= =============

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 pocketphinx构建轮失败对于pocketsphinx运行setup.py clean无法构建pocketsphinx安装收集的软件包:pocketsphinx为pocketsphinx运行setup.py安装...错误从命令/ 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','\\ n'); f.close(); exec(compile(code, file ,'exec'))“install --record /tmp/pip-record-6n9ewg9i/install-record.txt -单版本外部管理 - 编译:运行安装运行build_ext构建'sphinxbase._sphinxbase'扩展swigging deps / sphinxbase / swig / sphinxbase.i到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无法执行 'swig': No such file or directory error: command 'swig' failed with exit status 1 'swig':没有这样的文件或目录错误:命令'swig'失败,退出状态为1

=========================================================================== Thank you, Ling ================================================== =========================谢谢你,凌

In google colab Bash commands run by prefixing the command with '!'. 在google colab中,Bash命令通过在命令前加上'!'来运行。

Example: 例:

!apt update
!apt-get install libasound2-dev

Nope you can't use sudo because you don't get root access for colab. 不,你不能使用sudo因为你没有得到colab的root访问权限。

The problem is that you don't just need libasound2-dev but a whole host of packages. 问题是你不仅需要libasound2-dev还需要libasound2-dev软件包。 Check debian requirements in https://textract.readthedocs.io/en/stable/installation.html https://textract.readthedocs.io/en/stable/installation.html中检查debian要求

Also in order to build sphinx (a requirement for textract ) you need libpulse-dev . 另外,为了构建sphinxtextract的要求),你需要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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM