第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

沒有名為 Appkit 的模塊。如果我嘗試在 pycharm 中安裝它

沒有名為 Appkit 的模塊。如果我嘗試在 pycharm 中安裝它

幕布斯6054654 2023-10-31 21:48:34
我正在使用 pycharm 來解決這個問題,但我似乎不知道如何修復(fù)這個錯誤。Exception in Tkinter callbackTraceback (most recent call last):? File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/__init__.py", line 1883, in __call__? ? return self.func(*args)? File "/Users/syedrishad/PycharmProjects/OpenCVPython/venv/Text To Speech.py", line 44, in Text_to_speech? ? playsound('DataFlair.mp3')? File "/Users/syedrishad/OpenCVPython/lib/python3.8/site-packages/playsound.py", line 55, in _playsoundOSX? ? from AppKit? ? ?import NSSoundModuleNotFoundError: No module named 'AppKit'這是代碼:## import librariesfrom tkinter import *from gtts import gTTSfrom playsound import playsound################### Initialized window####################root = Tk()root.geometry('350x300')root.resizable(0,0)root.config(bg = 'ghost white')root.title('DataFlair - TEXT_TO_SPEECH')##headingLabel(root, text = 'TEXT_TO_SPEECH' , font='arial 20 bold' , bg ='white smoke').pack()Label(root, text ='DataFlair' , font ='arial 15 bold', bg = 'white smoke').pack(side = BOTTOM)#labelLabel(root, text ='Enter Text', font ='arial 15 bold', bg ='white smoke').place(x=20,y=60)##text variableMsg = StringVar()#Entryentry_field = Entry(root,textvariable =Msg, width ='50')entry_field.place(x=20 , y=100)###################define function##############################def Text_to_speech():? ? Message = entry_field.get()? ? speech = gTTS(text = Message)? ? speech.save('DataFlair.mp3')? ? playsound('DataFlair.mp3')def Exit():? ? root.destroy()def Reset():? ? Msg.set("")#ButtonButton(root, text = "PLAY" , font = 'arial 15 bold', command = Text_to_speech, width =4).place(x=25, y=140)Button(root,text = 'EXIT',font = 'arial 15 bold' , command = Exit, bg = 'OrangeRed1').place(x=100,y=140)Button(root, text = 'RESET', font='arial 15 bold', command = Reset).place(x=175 , y =140)#infinite loop to run programroot.mainloop()我對此感到非常困惑,其他人的解決方案對我不起作用。任何幫助將不勝感激。我已經(jīng)嘗試解決這個問題一周了。哦,這不是我的代碼。
查看完整描述

1 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗 獲得超4個贊

你還沒有AppKit安裝。這就是口譯員抱怨的原因。

您必須安裝該軟件包,有兩種可能性:

  1. 在終端類型中 pip install AppKit

  2. 在 PyCharm 中執(zhí)行以下操作:首選項 -> 項目解釋器 -> 單擊“+” -> 類型AppKit-> 安裝包

瞧,它現(xiàn)在應(yīng)該可以工作了。


查看完整回答
反對 回復(fù) 2023-10-31
  • 1 回答
  • 0 關(guān)注
  • 205 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號