[英]Can't install textract on windows
I've tried lots of things but still fail when I'm trying to install textract package on my Windows by using pip command. 当我尝试使用pip命令在我的Windows上安装textract软件包时,我尝试了很多东西但仍然失败了。
I'm getting the following error: 我收到以下错误:
I have no idea what to do, so I'll be really grateful for any advice. 我不知道该怎么做,所以我会非常感激任何建议。 Thank you
谢谢
Needed to first install swig from conda (miniconda) 需要先从conda(miniconda)安装swig
conda install swig
Then downloaded the EbookLib 0.15 zip from the releases 然后从发行版下载了EbookLib 0.15 zip
https://github.com/aerkalov/ebooklib/releases
After unzipping it, I manually removed (I used notepad++) the unicode char in the README.md file. 解压后,我手动删除(我使用notepad ++)README.md文件中的unicode char。 (unicode char is on Line 44)
(unicode char在44行)
And then installed the module with pip. 然后用pip安装模块。
cd to_unzipped_folder_path_here
pip install .
And finally 最后
pip install textract
(Windows 10, Python 3.7) I had more issues than others, but this builds off of previous answers : (Windows 10,Python 3.7)我遇到了比其他问题更多的问题,但这是基于以前的答案:
Make sure that Microsoft Visual Studio C++ Compiler for Python is installed 确保安装了Microsoft Visual Studio C ++ Compiler for Python
python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade pip setuptools wheel
pip install six --upgrade pip安装六 - 升级
Download EbookLib version 0.15: 下载EbookLib版本0.15:
Download Swig: 下载Swig:
cd into the unzipped Ebooklib folder from the prompt : eg C:> cd "C:\\Users\\username\\Desktop\\ebooklib-0.15" 从提示符进入解压缩的Ebooklib文件夹:例如C:> cd“C:\\ Users \\ username \\ Desktop \\ ebooklib-0.15”
run the installation for EbookLib : pip install . 运行EbookLib的安装:pip install。
run the textract installation : pip install textract 运行textract安装:pip install textract
The output should be : 输出应该是:
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>
At the time of this writing, jsonschema will have conflicting dependencies with textract. 在撰写本文时,jsonschema将与textract存在冲突的依赖关系。 The following errors also arose as I tried to figure out the proper installation :
当我试图找出正确的安装时,也出现了以下错误:
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'
The solution is much simpler now that the project appears to have been taken over by another individual (recently started updating the project again as of 3 months ago when I wrote this answer.) 由于该项目似乎已由另一个人接管,因此解决方案要简单得多(最近3个月前,当我写下这个答案时,我们再次开始更新项目。)
You can now go to https://github.com/deanmalmgren/textract/releases and download v1.6.2
which provides only requirement updates over v1.6.1 (fixing the unicode debug error) or v1.6.3
which is the latest (as of writing this.) 您现在可以访问https://github.com/deanmalmgren/textract/releases并下载
v1.6.2
,它仅提供v1.6.1(修复unicode调试错误)或v1.6.3
(最新版本)的需求更新(截至写这个。)
Once downloaded, extract, cd [folder extracted to]
and pip install .
下载后,解压缩,
cd [folder extracted to]
和pip install .
Just keep in mind there is always the concern that as requirements are updated malicious code can be inserted into dependencies and update this at your own risk. 请记住,始终存在这样的担忧:随着需求的更新,恶意代码可以插入到依赖项中并更新此风险,风险自负。
Not the most elegant solution but it works! 不是最优雅的解决方案但它的工作原理!
pip install git+https://github.com/jpweytjens/textract
Thanks to jpweytjens 感谢jpweytjens
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.