找不到模块pip



由于某种原因,我的pttsx3模块找不到,我安装了它,无论是否有虚拟环境,它甚至通过pip列表显示我在pip安装中有它

(env) PS E:Programs I wrote hehMy Aibin>  e:; cd 'e:Programs I wrote hehMy Aibin'; & 'C:UsersmmmkeAppDataLocalProgramsPythonPython39python.exe' 'c:Usersmmmke.vscodeextensionsms-python.python-2021.11.1422169775pythonFileslibpythondebugpylauncher' '63935' '--' 'e:Programs I wrote hehMy AibinText to speach.py' 
Traceback (most recent call last):
File "C:UsersmmmkeAppDataLocalProgramsPythonPython39librunpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
exec(code, run_globals)
File "c:Usersmmmke.vscodeextensionsms-python.python-2021.11.1422169775pythonFileslibpythondebugpy__main__.py", line 45, in <module>
cli.main()
File "c:Usersmmmke.vscodeextensionsms-python.python-2021.11.1422169775pythonFileslibpythondebugpy/..debugpyservercli.py", line 444, in main
run()
File "c:Usersmmmke.vscodeextensionsms-python.python-2021.11.1422169775pythonFileslibpythondebugpy/..debugpyservercli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
File "C:UsersmmmkeAppDataLocalProgramsPythonPython39librunpy.py", line 268, in run_path
File "C:UsersmmmkeAppDataLocalProgramsPythonPython39librunpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:UsersmmmkeAppDataLocalProgramsPythonPython39librunpy.py", line 87, in _run_code
exec(code, run_globals)
File "e:Programs I wrote hehMy AibinText to speach.py", line 1, in <module>
import pyttsx3 #pip install pyttsx3
ModuleNotFoundError: No module named 'pyttsx3'
(env) PS E:Programs I wrote hehMy Aibin> which python
which : The term 'which' 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
+ which python
+ ~~~~~
+ CategoryInfo          : ObjectNotFound: (which:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

(env) PS E:Programs I wrote hehMy Aibin> pip list
Package    Version
---------- -------
comtypes   1.1.10
pip        20.2.3
pypiwin32  223
pyttsx3    2.90
pywin32    302
setuptools 49.2.1
wheel      0.37.0
WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available.
You should consider upgrading via the 'e:programs i wrote hehmy aibinenvscriptspython.exe -m pip install --upgrade pip' command.
(env) PS E:Programs I wrote hehMy Aibin> 

你说你没有使用虚拟环境,但你的pip似乎属于的python

e:programs i wrote hehmy aibinenvscriptspython.exe

而你用来运行脚本的python(有导入行(是

C:UsersmmmkeAppDataLocalProgramsPythonPython39python.exe

因此,要么使用e:programs i wrote hehmy aibinenvscriptspython.exe运行脚本,要么安装正确的python:

C:UsersmmmkeAppDataLocalProgramsPythonPython39python.exe -m pip install ...

最新更新