答案 0 :(得分:9)
从here被盗:
需要首先从conda(miniconda)安装swig
conda install swig
然后从发行版中下载EbookLib 0.15 zip
https://github.com/aerkalov/ebooklib/releases
解压缩后,我手动删除(我使用了notepad ++)README.md文件中的unicode char。 (unicode字符位于第44行)
然后使用pip安装该模块。
cd to_unzipped_folder_path_here
pip install .
最后
pip install textract
答案 1 :(得分:0)
(Windows 10,Python 3.7) 我的问题比其他问题多,但这是基于先前的答案:
确保已安装用于Python的Microsoft Visual Studio C ++编译器
python -m pip install --upgrade pip setuptools轮
pip安装六个--upgrade
下载EbookLib 0.15版:
下载Swig:
cd从提示符进入解压缩的Ebooklib文件夹: C:> CD “ C:\ Users \ username \ Desktop \ ebooklib-0.15”
运行EbookLib的安装:pip install。
运行textract安装:pip install textract
输出应为:
C:\Users\username\Desktop\ebooklib-0.15>pip install textract
Collecting textract
Requirement already satisfied: docx2txt==0.6 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (0.6)
Requirement already satisfied: beautifulsoup4==4.5.3 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (4.5.3)
Requirement already satisfied: EbookLib==0.15 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (0.15)
Requirement already satisfied: xlrd==1.0.0 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (1.0.0)
Requirement already satisfied: SpeechRecognition==3.6.3 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (3.6.3)
Requirement already satisfied: six==1.10.0 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (1.10.0)
Collecting pocketsphinx==0.1.3 (from textract)
Using cached https://files.pythonhosted.org/packages/93/5f/a968e5d53d25e32deb78c3e169fd8612ecf53cc76e32cb40e19be35696af/pocketsphinx-0.1.3.tar.bz2
Requirement already satisfied: chardet==2.3.0 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (2.3.0)
Requirement already satisfied: argcomplete==1.8.2 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (1.8.2)
Requirement already satisfied: python-pptx==0.6.5 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from textract) (0.6.5)
Requirement already satisfied: lxml in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from EbookLib==0.15->textract) (4.3.3)
Requirement already satisfied: XlsxWriter>=0.5.7 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from python-pptx==0.6.5->textract) (1.1.8)
Requirement already satisfied: Pillow>=2.6.1 in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (from python-pptx==0.6.5->textract) (6.0.0)
Building wheels for collected packages: pocketsphinx
Building wheel for pocketsphinx (setup.py) ... done
Stored in directory: C:\Users\username\AppData\Local\pip\Cache\wheels\38\80\4f\ddc3e8c2b788f2c7f1d625ae870f6bafd3038ff04a3445a2f8
Successfully built pocketsphinx
Installing collected packages: pocketsphinx, textract
Successfully installed pocketsphinx-0.1.3 textract-1.6.1
C:\Users\username\Desktop\ebooklib-0.15>
在撰写本文时,jsonschema与textract的依赖项存在冲突。当我尝试找出正确的安装方式时,还会出现以下错误:
ERROR: requests 2.22.0 has requirement chardet<3.1.0,>=3.0.2, but you'll have chardet 2.3.0 which is incompatible.
ERROR: camelot-py 0.7.2 has requirement chardet>=3.0.4, but you'll have chardet 2.3.0 which is incompatible.
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\username\AppData\Local\Temp\pip-install-msmb9od3\EbookLib\
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 1671: character maps to <undefined>
error: command 'C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python37\\swig.exe' failed with exit status 1
ERROR: Failed building wheel for pocketsphinx
error: command 'swig.exe' failed: No such file or directory
(1) : Error: Unable to find 'swig.swg'
(3) : Error: Unable to find 'python.swg'
答案 2 :(得分:0)
既然该项目似乎已由另一个人接管(最近写的答案是3个月前,当我撰写此答案时,最近又开始更新该项目),解决方案就更加简单了。
您现在可以转到https://github.com/deanmalmgren/textract/releases并下载v1.6.2
,它仅提供v1.6.1上的要求更新(修复了unicode调试错误)或最新的v1.6.3
(在撰写本文时)这个。)
下载后,解压缩cd [folder extracted to]
和pip install .
请紧记,始终存在着这样的担忧,即随着需求的更新,恶意代码可能会插入到依赖项中,并自行承担风险。
答案 3 :(得分:0)
这不是最优雅的解决方案,但它可以工作!
pip install git+https://github.com/jpweytjens/textract
感谢jpweytjens