我无法在 google colab 中安装 textract
,错误消息如下所示。
有些人建议使用 sudo apt-get install libasound2-dev
但如何在 google colab 中执行 sudo...
?
===错误信息========================================== ================
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
============================================= ============================ 谢谢你, 玲
最佳答案
不,您不能使用 sudo
,因为您没有获得 colab 的 root
访问权限。
问题是您不仅需要libasound2-dev
,还需要一大堆软件包。检查 https://textract.readthedocs.io/en/stable/installation.html 中的 debian 要求
此外,为了构建 sphinx
(textract
的要求),您需要 libpulse-dev
。所以这是更新后的命令列表。
!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
关于python - 无法在 google colab 中安装 textract,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54122807/