'Can't install Kivy in Python
I installed kivy with python -m pip install kivy and python -m pip install kivy[full] kivy-examples, I tried hundreds of different installing methods, I tried to execute as an administrator with --force-reinstall but if I write import kivy.app, this is the output:
[INFO ] [Logger ] Record log in C:\Users\simon\.kivy\logs\kivy_22-01-23_3.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.3.3
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "C:\Python310\lib\kivy\__init__.py"
[INFO ] [Python ] v3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Python310\pythonw.exe"
[ERROR ] [Clock ] Unable to import kivy._clock. Have you perhaps forgotten to compile kivy? Kivy contains Cython code which needs to be compiled. A missing kivy._clock often indicates the Cython code has not been compiled. Please follow the installation instructions and make sure to compile Kivy
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import kivy.app
File "C:\Python310\lib\kivy\app.py", line 411, in <module>
from kivy.base import runTouchApp, async_runTouchApp, stopTouchApp
File "C:\Python310\lib\kivy\base.py", line 28, in <module>
from kivy.clock import Clock
File "C:\Python310\lib\kivy\clock.py", line 466, in <module>
from kivy._clock import CyClockBase, ClockEvent, FreeClockEvent, \
ModuleNotFoundError: No module named 'kivy._clock'
But if I just execute import kivy it works. What should I do?
In Python 3.9 it works.
Solution 1:[1]
The output shows that kivy uses python version 3.10 and for that version, kivy is still in development status.
So if you have no problem changing your python version you can use version 3.8.10 that's what I am currently using with kivy.
Then just simply pip install kivy and the import import kivy.app works just as intedend
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gerda die gandalfziege |
