【问题标题】:How to install textract in python3如何在python3中安装文本
【发布时间】:2018-05-09 01:24:09
【问题描述】:
sudo python3 -m pip install textract
sudo apt-get install textract
pip install textract
sudo apt-get install swig

我想在 python3 中安装 textract,但安装方式不正确,会出现以下错误。

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c swig/sphinxbase/ad_wrap.c -o build/temp.linux-x86_64-2.7/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 -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-x86_64-2.7/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

【问题讨论】:

    标签: python-3.5 text-extraction


    【解决方案1】:

    按照以下步骤操作:

    1. https://pypi.python.org/pypi/textract下载文本的源文件

    2. pip3 安装 pdfminer3k

    3. 解压下载的文件

    4. cd 进入目录

    5. 运行:python3 setup.py install

    【讨论】:

    • 当我尝试安装 pdfminer3k 时出现“错误:安装脚本退出并出现错误:命令 'swig' 失败,退出状态为 1”我尝试使用 brew 安装 swig 但没有成功
    【解决方案2】:

    您需要先在 Ubuntu 中安装 libpulse-dev 或在 Fedora 中安装 pulseaudio-libs-devel

    • 如果您使用的是 Ubuntu,请尝试 sudo apt-get install libpulse-dev
    • 如果您使用 Fedora,请尝试 sudo dnf install pulseaudio-libs-devel

    至少这对我有用。

    【讨论】:

      【解决方案3】:

      首先在 conda 中安装 pip。 python -m pip install --upgrade pip

      然后安装文本,pip install textract

      【讨论】:

        【解决方案4】:

        回复较晚,但您应该查看 conda 而不是 pip,它在安装此软件包方面更加封装。

        要使用 conda 安装此软件包,请运行以下操作之一:

        conda install -c conda-forge textract
        conda install -c conda-forge/label/cf201901 textract
        conda install -c conda-forge/label/cf202003 textract
        

        来源: https://anaconda.org/conda-forge/textract

        【讨论】:

          【解决方案5】:

          您可以使用以下命令安装它:

          pip install git+https://github.com/deanmalmgren/textract.git
          

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2017-03-28
            • 2018-11-15
            • 2014-12-27
            • 1970-01-01
            • 2018-01-23
            • 2019-10-18
            • 2021-10-17
            • 2014-03-22
            相关资源
            最近更新 更多