簡體   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