注意能够在 vscode ubuntu 上导入 gi 模块

注意能够在 vscode ubuntu 上导入 gi 模块
 /home/don_quixote/anaconda3/bin/python "/home/don_quixote/Desktop/voice assistence/voice.py"
Traceback (most recent call last):
  File "/home/don_quixote/Desktop/voice assistence/voice.py", line 12, in <module>
    speak("hello Abhishek")
  File "/home/don_quixote/Desktop/voice assistence/voice.py", line 10, in speak
    playsound.playsound(filename)
  File "/home/don_quixote/anaconda3/lib/python3.7/site-packages/playsound.py", line 91, in _playsoundNix
    import gi
ModuleNotFoundError: No module named 'gi'

答案1

应该能够使用pip3 install PyGObject或安装它pip install PyGObject。您可能还需要sudo根据安装情况在命令前加上前缀。

相关内容