安装Textract时如何为EbookLib修复“ UnicodeDecodeError”?

时间:2019-05-26 16:29:54

标签: python pip package

当尝试在Windows 10上的pycharm中安装Textract软件包时,软件包安装程序在README.md中为EbookLib 0.15返回UnicodeDecodeError。

我尝试了以下提供的解决方案:https://github.com/deanmalmgren/textract/issues/194

,除了运行pip install textract以外,提供的解决方案几乎适用于EbookLib 在终端中似乎没有安装实际的模块。

E:\Main>pip install textract
Requirement already satisfied: textract in e:\conda\lib\site-packages (1.6.1)
Requirement already satisfied: EbookLib==0.15 in e:\ebooklib-0.15 (from textract) (0.15)
Requirement already satisfied: python-pptx==0.6.5 in e:\conda\lib\site-packages (from textract) (0.6.5)
Requirement already satisfied: argcomplete==1.8.2 in e:\conda\lib\site-packages (from textract) (1.8.2)
Requirement already satisfied: docx2txt==0.6 in e:\conda\lib\site-packages (from textract) (0.6)
Requirement already satisfied: SpeechRecognition==3.6.3 in e:\conda\lib\site-packages (from textract) (3.6.3)
Requirement already satisfied: xlrd==1.0.0 in e:\conda\lib\site-packages (from textract) (1.0.0)
Requirement already satisfied: six==1.10.0 in e:\conda\lib\site-packages (from textract) (1.10.0)
Requirement already satisfied: chardet==2.3.0 in e:\conda\lib\site-packages (from textract) (2.3.0)
Requirement already satisfied: beautifulsoup4==4.5.3 in e:\conda\lib\site-packages (from textract) (4.5.3)
Requirement already satisfied: pocketsphinx==0.1.3 in e:\conda\lib\site-packages (from textract) (0.1.3)
Requirement already satisfied: lxml in e:\conda\lib\site-packages (from EbookLib==0.15->textract) (4.3.3)
Requirement already satisfied: XlsxWriter>=0.5.7 in e:\conda\lib\site-packages (from python-pptx==0.6.5->textract)
(1.1.8)
Requirement already satisfied: Pillow>=2.6.1 in e:\conda\lib\site-packages (from python-pptx==0.6.5->textract) (6.0
.0)
>>>import textract

Traceback (most recent call last):
  File "E:/Main/Main.py", line 22, in <module>
    import textract
ModuleNotFoundError: No module named 'textract'

安装程序应正确接收EbookLib版本并运行其setup.py,但最终使用的是已缓存的有缺陷的版本,而不是我解码的本地文件。

Collecting EbookLib==0.15 (from textract)
  Using cached https://files.pythonhosted.org/packages/04/30/2cbf65fa9587a1ecc66a78eea91f9189ead8fdadd5e009115bce34529aa6/EbookLib-0.15.tar.gz

    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Feraz\AppData\Local\Temp\pycharm-packaging\EbookLib\setup.py", line 13, in <module>
        long_description = open('README.md').read(),
      File "E:\Python37\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>
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Feraz\AppData\Local\Temp\pycharm-packaging\EbookLib\

0 个答案:

没有答案