I have some problém with kivy

I have installed Python 3.8.5 on my MAC and i cant run it. It shows som errors when installing.

Hello @oleksandr.ievlakhov1

I learned from another course that covers Kivy it does not goes well with Python versions higher that 3.6
I don´t know if it include all subversion 3.6.(first) - 3.6.(last).

I use 3.6.5 and Kivy is OK with that version.

so you suggest to delete 3.8 and install 3.6 instead ?

No. Absolutely do NOT uninstall your current version.

I suggest you use pyenv to install more versions. Pyenv is a kind of “tool” that allow you to have multiple versions installed and choose which one to use for separate projects.

I followed this tutorial to install pyenv and then another version (3.6.5 for Kivy).

There is a guide for Mac as well.
Give it a try.

Thank you so much I will try it this way and will see :wink:

Please tell if you got it working.
Which editor are you using for writing your code?
If you are using Pycharm there is a little bit more to do.

Yes I am using PyCharm. I didn’t have a time yet but I’ll try it now. What I need to do ?

Hello @oleksandr.ievlakhov1

When I was looking for the guide I used (I am on a linux machine) I came across this tip for Mac users.

From StackOverflow . Scroll down l little bit.

I hope it’s useful.

Thanks I tried it. But it still won’t work. When I try import Kivy it returns error:
File “main.py”, line 1, in
import kivy
ModuleNotFoundError: No module named ‘kivy’

Have you done:

pip install kivy

Yes I have it installed.

How does your code look like?

If you show us more can help you with this.

[code]
Paste your code in like this. 
[/code]

I think @oleksandr.ievlakhov1 You’d first want to use the 3.6.5 version that @ulfen69 recommends, then you have to make sure you are doing a correct import from where your code is. The main problem is you are probably inside PyCharm, so you have to configure your project in PyCharm to have access to the Kivy package. I’d search PyCharm’s documentation, or possibly go ask on their forum (you are a paying customer after all, they should help you).

I switched it to 3.6.5 in my terminál and also in my pycharm project. But i am using free version of pycharm fór now cause i am beginner. Couple it be problém with free version ?
I will try again step by step. Maybe i Missed something.

import kivy

from kivy.app import App
from kivy.uix.label import Label


class MyKivyApp(App):
    def build(self):
        return Label(text="This is my first Kivy app")


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

Try removing PyCharm from the problem. Ensure you are in the correct directory and using python 3.6.5 in Terminal. Run the file…what happens?

1 Like

Finally got it. Thanks for help everyone :wink:

Hey @oleksandr.ievlakhov1, can you drop the solution in case someone else comes along and has this problem?

Hello

I am interested in if you got pyenv installed successfully?
And if you can see and use Python 3.6.x in pycharm?
If so there is s nice file to download and use with kivy in pycharm.

Kivy completion