F
F
fdfdd dsdsds2020-05-07 15:01:42
Python
fdfdd dsdsds, 2020-05-07 15:01:42

Error Creating Ping Pong With Python?

here is the script

from kivy.app import App
from Kivy.uix.widget import Widget


class PongGame(Widget):
  pass

class PongApp(App):
  def build(self):
    return PongGame()

if __name__ == '__main__':
  PongApp().run()


And here is the error itself:
[INFO   ] [Logger      ] Record log in C:\Users\Salaz\.kivy\logs\kivy_20-05-07_34.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.2.0
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Program Files\Python37\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Program Files\Python37\python.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif (img_sdl2, img_pil, img_ffpyplayer ignored)
 Traceback (most recent call last):
   File "C:\Python\main.py", line 2, in <module>
     from Kivy.uix.widget import Widget
 ModuleNotFoundError: No module named 'Kivy'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-05-07
@dilshad2019

You read the text of the error.
You write something like this, sometimes with a small letter, then with a capital letter, the name of the package.
there is critical:

from kivy.app import App
from Kivy.uix.widget import Widget

kivy and Kivy for python are different. The package is named with a small letter, and in the second line you import it with a capital letter. Of course it has not been found.
Here's about it and the error says: " No module named 'Kivy' "
File "C:\Python\main.py", line 2, in
from Kivy.uix.widget import Widget
ModuleNotFoundError: No module named 'Kivy'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question