簡體   English   中英

ModuleNotFoundError:沒有名為“pyttsx3”的模塊

[英]ModuleNotFoundError: No module named 'pyttsx3'

我在 Sublime text 中運行一個程序,但出現錯誤:

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\

我確實修好了。 首先,我通過 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

ModuleNotFoundError: No module named 'pyttsx3'
pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1
+ pip install pyttsx
+ ~~~
    + CategoryInfo          : ObjectNotFound: (pip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM