简体   繁体   English

Python 找不到已安装的模块

[英]Python not finding installed module

Okay so i wanted to try python and now i wanted to import a package (python-vlc) but it always tells me ModuleNotFoundError: No module named 'vlc' I installed and uninstalled it multiple times now and I am certain that it is installed in my global packages.好的,所以我想尝试 python 现在我想导入 package (python-vlc) 但它总是告诉我ModuleNotFoundError: No module named 'vlc'我现在安装和卸载了多次,我确定它安装在我的全球包裹。 I also installed tkinter and that package works like a charm and gets imported without any errors, and eventhough they are in the same folder it wont find vlc.我还安装了 tkinter 并且 package 就像一个魅力,并且没有任何错误地导入,即使它们在同一个文件夹中,它也不会找到 vlc。

For Context: I use Pycharm and this is my code:对于上下文:我使用 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()

I installed it with pip3 install python-vlc我用pip3 install python-vlc安装了它

Any Idea why Python only finds tkinter and not vlc eventhough they are both installed with pip and both in the same folder?知道为什么 Python 只找到 tkinter 而不是 vlc,即使它们都安装了 pip 并且两者都在同一个文件夹中?

You haven't used vlc module in any line.您还没有在任何行中使用vlc模块。 So please try commenting the import statement of vlc using '#'.所以请尝试使用“#”来注释 vlc 的导入语句。 Then you will get a blank violet coloured tkinter window as output.然后你会得到一个空白的紫色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. 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