0

我正在使用 Sublime 文本运行程序,但出现错误:

ModuleNotFoundError: No module named 'pyttsx3'

我打开命令提示符并输入: pip install pyttsx3 这就是我得到的

Collecting pyttsx3
  Using cached pyttsx3-2.90-py3-none-any.whl (39 kB)
Collecting comtypes; platform_system == "Windows"
  Using cached comtypes-1.1.7.zip (180 kB)
Requirement already satisfied: pywin32; platform_system == "Windows" in c:\users\claud\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pyttsx3) (228)
Requirement already satisfied: pypiwin32; platform_system == "Windows" in c:\users\claud\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pyttsx3) (223)
Using legacy 'setup.py install' for comtypes, since package 'wheel' is not installed.
Installing collected packages: comtypes, pyttsx3
    Running setup.py install for comtypes ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\claud\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\claud\\AppData\\Local\\Temp\\pip-install-zam0bo68\\comtypes\\setup.py'"'"'; __file__='"'"'C:\\Users\\claud\\AppData\\Local\\Temp\\pip-install-zam0bo68\\comtypes\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\claud\AppData\Local\Temp\pip-record-zh7s3m6p\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\claud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\comtypes'
         cwd: C:\Users\claud\AppData\Local\Temp\pip-install-zam0bo68\comtypes\
4

1 回答 1

0

我确实修好了。首先,我通过 C:\Users\claud\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe 升级了 pip 的版本

并遵循以下说明: https ://pip.pypa.io/en/stable/installing/

之后很容易 pip install pyttsx3

于 2020-11-03T20:45:25.310 回答