There is a Python problem with the kivy library

37 Views Asked by At

I wanted to install kivy but I have a problem: Error while finding module specification for 'kivy.examples.main' (ModuleNotFoundError: No module named 'kivy.examples').

To fix the problem, I tried to enter : pip install kivy-examples

It didn't work for me, so I tried to enter: python -m kivy.examples.demo

Then: python -m kivy.examples.__main__

but it didn't help me. .

1

There are 1 best solutions below

0
phd On

"kivy-examples" is not a module, it's a collection of programs. After running pip install kivy-examples in my virtual environment I found the collection in venv/share/kivy-examples/ directory. So you cannot import or run them as kivy.examples. Instead change dir to subdirectories under venv/share/kivy-examples/, find out application file (often but not always it's main.py) and run it like python main.py.