无法在 Windows 上安装 text_normalizer
Posted
技术标签:
【中文标题】无法在 Windows 上安装 text_normalizer【英文标题】:Cannot install text_normalizer on windows 【发布时间】:2020-02-17 01:15:21 【问题描述】:我尝试通过 Anaconda Prompt (anaconda3) 或 Jupyter Notebook pip install text_normalizer 并不断收到相同的错误
我以管理员身份登录。 pip3 也无法识别。不知道还能尝试什么。
C:\Users\username>pip install text_normalizer==0.1.3
Collecting text_normalizer==0.1.3
Using cached https://files.pythonhosted.org/packages/b7/98/b49628d90d5793e7369e25d6a84f9ca4a1fc6472d848d15daa9bf9129ad7/text-normalizer-0.1.3.tar.gz
ERROR: Command errored out with exit status 1:
command: 'C:\Users\username\AppData\Local\Continuum\anaconda3\envs\nlp\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-n646z_1p\\text-normalizer\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-n646z_1p\\text-normalizer\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\username\AppData\Local\Temp\pip-install-n646z_1p\text-normalizer\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\username\AppData\Local\Temp\pip-install-n646z_1p\text-normalizer\setup.py", line 14, in <module>
long_description = f.read()
File "C:\Users\username\AppData\Local\Continuum\anaconda3\envs\nlp\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 0x9d in position 712: character maps to <undefined>
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
【问题讨论】:
"检查日志以获取完整的命令输出。"日志在说什么? 【参考方案1】:我发现了问题。我正在使用“Text Analytics with Python: A Practitioner's Guide to Natural Languagecessi Processing, Second Edition”一书中的示例 由 Dipanjan Sarkar,2019 年。”并且必须连接到 text_normalizer.py 而不是加载 text_normalizer 包。示例中缺少该文件。 非常感谢您的及时回复
【讨论】:
以上是关于无法在 Windows 上安装 text_normalizer的主要内容,如果未能解决你的问题,请参考以下文章
无法在 Windows 10 上安装 Windows SDK 7.1