繁体   English   中英

未找到模块 pip

[英]Module not found pip

出于某种原因,找不到我的 pttsx3 模块,我在有和没有虚拟环境的情况下都安装了它,它甚至显示我在 pip 中安装了它,通过 pip 列表安装

(env) PS E:\Programs I wrote heh\My Ai\bin>  e:; cd 'e:\Programs I wrote heh\My Ai\bin'; & 'C:\Users\mmmke\AppData\Local\Programs\Python\Python39\python.exe' 'c:\Users\mmmke\.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\python\debugpy\launcher' '63935' '--' 'e:\Programs I wrote heh\My Ai\bin\Text to speach.py' 
Traceback (most recent call last):
  File "C:\Users\mmmke\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
    exec(code, run_globals)
  File "c:\Users\mmmke\.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
    cli.main()
  File "c:\Users\mmmke\.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
    run()
  File "c:\Users\mmmke\.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "C:\Users\mmmke\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path
  File "C:\Users\mmmke\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "C:\Users\mmmke\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "e:\Programs I wrote heh\My Ai\bin\Text to speach.py", line 1, in <module>
    import pyttsx3 #pip install pyttsx3
ModuleNotFoundError: No module named 'pyttsx3'
(env) PS E:\Programs I wrote heh\My Ai\bin> 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 heh\My Ai\bin> 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 heh\my ai\bin\env\scripts\python.exe -m pip install --upgrade pip' command.
(env) PS E:\Programs I wrote heh\My Ai\bin> 

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

e:\programs i wrote heh\my ai\bin\env\scripts\python.exe

而您用来运行脚本(具有导入行)的 python 是

C:\Users\mmmke\AppData\Local\Programs\Python\Python39\python.exe

所以要么使用e:\programs i wrote heh\my ai\bin\env\scripts\python.exe来运行你的脚本,要么安装正确的 python:

C:\Users\mmmke\AppData\Local\Programs\Python\Python39\python.exe -m pip install ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM