繁体   English   中英

Python 找不到已安装的模块

[英]Python not finding installed module

好的,所以我想尝试 python 现在我想导入 package (python-vlc) 但它总是告诉我ModuleNotFoundError: No module named 'vlc'我现在安装和卸载了多次,我确定它安装在我的全球包裹。 我还安装了 tkinter 并且 package 就像一个魅力,并且没有任何错误地导入,即使它们在同一个文件夹中,它也不会找到 vlc。

对于上下文:我使用 Pycharm 这是我的代码:

from tkinter import *
import vlc


window = Tk()

# window title
window.title("Test")

window.configure(width=800, height=500)
window.configure(bg='#430752')
window.mainloop()

我用pip3 install python-vlc安装了它

知道为什么 Python 只找到 tkinter 而不是 vlc,即使它们都安装了 pip 并且两者都在同一个文件夹中?

您还没有在任何行中使用vlc模块。 所以请尝试使用“#”来注释 vlc 的导入语句。 然后你会得到一个空白的紫色tkinter window 作为 output。

if you're using windows, then open the command prompt from the start by searching cmd , then type pip install python-vlc and restart the pycharm IDE.

暂无
暂无

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

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