python - pyttsx3 NameError 的 pip 安装突然失败:未定义名称“平台系统”
问题描述
我无法在 Windows 上安装 pyttsx3,当我执行 pip install pyttsx3 时出现以下错误,请帮助我,请注意我已经运行了命令 pip --upgrade setuptools
Exception:
Traceback (most recent call last):
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2795, in _dep_map
return self.__dep_map
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2652, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\commands\install.py", line 294, in run
requirement_set.prepare_files(finder)
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\req\req_set.py", line 333, in prepare_files
self._walk_req_to_install(
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\req\req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\req\req_set.py", line 561, in _prepare_file
set(req_to_install.extras) - set(dist.extras)
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2774, in extras
return [dep for dep in self._dep_map if dep]
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2797, in _dep_map
self.__dep_map = self._compute_dependencies()
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2830, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2827, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "c:\users\gamer\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\_markerlib\markers.py", line 113, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'platform_system' is not defined
解决方案
尝试更新setuptools
. 另外,升级pip
使用pip install --upgrade pip
. 并尝试以管理员身份运行该命令。
推荐阅读
- json - 是否有用于向 YAML/JSON 添加简单引用函数的通用库,例如在 CloudFormation 中?
- javascript - 如何在反应中将组件重置为其初始状态
- python - 按注释排序 crontab -l
- javascript - 即使使用导出,Index.js 也不会导入 App.js
- python - 在numpy中计算协方差矩阵
- python - 如何制作多线程和异步 Python 不和谐机器人
- django - Djongo:不支持的查找
用于 EmbeddedField 或加入不允许的字段 - reactjs - 为什么刷新后数据会进入reactjs中的数组
- jquery - jquery基于select2填写表单字段
- python - 使用 before_invoke 取消命令而不打印错误消息 (discord.py)