我正在尝试安装textract并收到错误消息>我正在使用Anaconda所以我试过了:
pip install -i https://pypi.anaconda.org/pypi/simple textract
我收到以下错误:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-4rh6j3p5\Ebo
我也尝试过:
pip install textract
并得到了同样的错误。
首先我尝试升级setup_tools:
pip install --upgrade setuptools
但它说它已经是最新的了
我也尝试过:
pip install ez_setup
但是说要求已经满足了。我不认为这会是问题,因为我可以使用pip来安装其他软件包,而不是这个。
但是,当我尝试运行ez_setup时:
python ez_setup.py
我收到此错误:
TypeError: chown() missing 1 required positional argument: 'numeric_owner'
PS C:\Users\User\Anaconda3\Lib\site-packages>
我不确定是否相关。我也尝试过:
easy_install textract
得到了这个错误:
Searching for textract
Reading https://pypi.python.org/simple/textract/
Downloading https://pypi.python.org/packages/23/4d/0141a229be5edfc5d41efbf7757c050df9820cdee38eae67c08788269152/textract
-1.5.0.tar.gz#md5=29ac38f836a6e6146962d2d70505ffa5
Best match: textract 1.5.0
Processing textract-1.5.0.tar.gz
Writing C:\Users\User\AppData\Local\Temp\easy_install-sd7jvx24\textract-1.5.0\setup.cfg
Running textract-1.5.0\setup.py -q bdist_egg --dist-dir C:\Users\User\AppData\Local\Temp\easy_install-sd7jvx24\textrac
t-1.5.0\egg-dist-tmp-d1fv4qbg
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no previously-included files matching '*~' found under directory '*'
warning: no previously-included files matching '*.orig' found under directory '*'
creating c:\users\User\anaconda3\lib\site-packages\textract-1.5.0-py3.5.egg
Extracting textract-1.5.0-py3.5.egg to c:\users\User\anaconda3\lib\site-packages
Adding textract 1.5.0 to easy-install.pth file
Installing textract script to C:\Users\User\Anaconda3\Scripts
Installed c:\users\User\anaconda3\lib\site-packages\textract-1.5.0-py3.5.egg
Reading https://github.com/mattgwwalker/msg-extractor/zipball/master
Processing dependencies for textract
Searching for SpeechRecognition>=3.1.0
Reading https://pypi.python.org/simple/SpeechRecognition/
Downloading https://pypi.python.org/packages/ce/0f/e14418e1797e3b6326618b3b4d1940734ed55878df64812784a7b6168eb5/SpeechRe
cognition-3.6.0.tar.gz#md5=00c6b126dc3494a71bcf57fb693e5644
Best match: SpeechRecognition 3.6.0
Processing SpeechRecognition-3.6.0.tar.gz
Writing C:\Users\User\AppData\Local\Temp\easy_install-08mttkkw\SpeechRecognition-3.6.0\setup.cfg
Running SpeechRecognition-3.6.0\setup.py -q bdist_egg --dist-dir C:\Users\User\AppData\Local\Temp\easy_install-08mttkk
w\SpeechRecognition-3.6.0\egg-dist-tmp-w2rf0wr0
zip_safe flag not set; analyzing archive contents...
speech_recognition.__pycache__.__init__.cpython-35: module references __file__
creating c:\users\User\anaconda3\lib\site-packages\speechrecognition-3.6.0-py3.5.egg
Extracting speechrecognition-3.6.0-py3.5.egg to c:\users\User\anaconda3\lib\site-packages
Adding speechrecognition 3.6.0 to easy-install.pth file
Installed c:\users\User\anaconda3\lib\site-packages\speechrecognition-3.6.0-py3.5.egg
Searching for EbookLib
Reading https://pypi.python.org/simple/EbookLib/
Downloading https://pypi.python.org/packages/04/30/2cbf65fa9587a1ecc66a78eea91f9189ead8fdadd5e009115bce34529aa6/EbookLib
-0.15.tar.gz#md5=d29882a04477c3854b1af9f6a84dc160
Best match: EbookLib 0.15
Processing EbookLib-0.15.tar.gz
Writing C:\Users\User\AppData\Local\Temp\easy_install-vcyqjzub\EbookLib-0.15\setup.cfg
Running EbookLib-0.15\setup.py -q bdist_egg --dist-dir C:\Users\User\AppData\Local\Temp\easy_install-vcyqjzub\EbookLib
-0.15\egg-dist-tmp-ybq3stsw
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 157, in sav
e_modules
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 198, in set
up_context
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 255, in run
_setup
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 285, in run
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 253, in run
ner
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 47, in _exe
cfile
File "C:\Users\User\AppData\Local\Temp\easy_install-vcyqjzub\EbookLib-0.15\setup.py", line 13, in <module>
File "C:\Users\User\Anaconda3\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 1671: character maps to <undefined>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\Scripts\easy_install-script.py", line 11, in <module>
load_entry_point('setuptools==32.3.1', 'console_scripts', 'easy_install')()
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 2270, in main
File "C:\Users\User\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\User\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\User\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 411, in run
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 674, in easy_install
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 702, in install_item
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 747, in process_distribution
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\pkg_resources\__init__.py", line 846, in
resolve
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\pkg_resources\__init__.py", line 1118, i
n best_match
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\pkg_resources\__init__.py", line 1130, i
n obtain
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 674, in easy_install
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 700, in install_item
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 881, in install_eggs
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 1120, in build_and_install
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\command\easy_install.py", lin
e 1106, in run_setup
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 258, in run
_setup
File "C:\Users\User\Anaconda3\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 198, in set
up_context
File "C:\Users\User\Anaconda3\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 169, in sav
e_modules
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 144, in res
ume
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\pkg_resources\_vendor\six.py", line 685,
in reraise
raise value.with_traceback(tb)
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 157, in sav
e_modules
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 198, in set
up_context
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 255, in run
_setup
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 285, in run
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 253, in run
ner
File "C:\Users\User\Anaconda3\lib\site-packages\setuptools-32.3.1-py3.5.egg\setuptools\sandbox.py", line 47, in _exe
cfile
File "C:\Users\User\AppData\Local\Temp\easy_install-vcyqjzub\EbookLib-0.15\setup.py", line 13, in <module>
File "C:\Users\User\Anaconda3\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 1671: character maps to <undefined>
还有什么我可以尝试的吗?
答案 0 :(得分:0)
首先,您可以尝试运行pip check textract
,这将验证打包所需的任何依赖项。
所以看起来你正在运行windows,目前似乎不支持textract。 See here
您可能需要以下库,也可能需要其他库。
libxml2 2.6.21
或更高版本是.docx
解析器所必需的
通过python-docx使用lxml。
用户lxml通过python-docx的libxslt 1.1.15
解析器需要.docx
或更高版本。 antiword
是.doc
解析器所必需的。
{li> pdftotext
是.pdf
解析器可选的(如果未安装pdftotext
,则有一个纯python回退可行。)
{li> pstotext
是.ps
解析器所必需的。
{li} tesseract-ocr
是.jpg
,.png
和.gif
解析器所必需的。
{li} sox
是.mp3
和.ogg
解析器所必需的。
醇>
在构建sox之前,您需要先安装ffmpeg
,lame
,libmad0
和libsox-fmt-mp3
,才能使这些文件类型生效。