我是编程新手,在使用Mac OS Mojave 10.14.6和Python 3.6.7在Anaconda中安装pdftotext时遇到问题。我已经安装了所有推荐的依赖项(https://github.com/jalan/pdftotext(,但无法成功安装 pdftotext。
错误包括:
ERROR: Command errored out with exit status 1:
command: /anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3_/T/pip-install-ak3q4wz7/pdftotext/setup.py'"'"'; __file__='"'"'/private/var/folders/3_/T/pip-install-ak3q4wz7/pdftotext/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/3_/T/pip-install-ak3q4wz7/pdftotext/pip-egg-info
cwd: /private/var/folders/3_//T/pip-install-ak3q4wz7/pdftotext/
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我最终使用了poppler中的pdftotext而不是上面列出的软件包。这需要在蟒蛇中使用康达锻造安装波普勒。
对于 Mac:
conda create -n envname python=3.7
conda activate envname
conda config --add channels conda-forge
conda install poppler
ModuleNotFoundError:没有名为"setuptools"的模块
这表明您希望至少再安装一个依赖项:
$ conda install setuptools
或者pip install
,如果你愿意的话。