Incorporating Kivy into pyCharm Project

  • 2
  • 17

I am just starting out with pyCharm and I am really enjoying developing python applications with it.

My issues are that I am not really sure how to incorporate Kivy into a new project:

what I did:
under file->settings->project interpreter->Python interpreter, I've added the python interpreter that comes with Kivy. In the same window I also added a path to the Kivy folder I set up.

my issue: Kivy applications are executed with the kivy.bat file. So I am wondering how do I get pyCharm to run my application with the kivy.bat file, rather than the usual python interpreter. I have tried setting up kivy.bat as the python interpreter, but that didn't work.

Also, this line "from kivy.app import App" underlines "App" in the editor. pyCharm also underlines "Lable" in the next line.

I have managed to run my script outside of pyCharm so I know it's working.

So I have 2 issues:
  1. Running kivy applications with the kivy.bat file.
  2. Understanding why the editor doesn't recognize the kivy library.

The application:
import kivy
kivy.require('1.0.6') # replace with your current kivy version !

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


class MyApp(App):

    def build(self):
        return Label(text='Hello world')


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

This is the hello world example from: http://kivy.org/docs/guide/basic.html
Ill appreciate any lead.
Thanks for reading,
Boaz
Answered by Ekaterina Tuzova
 
Hi BJR,

what Kivy version do you use? Can you navigate to kivy.app on line 4 (using Ctrl + Click)?

For the kivy.bat you can create custom run command in Settings->External Tools and find this command in Tools menu than.
Hi BJR,

what Kivy version do you use? Can you navigate to kivy.app on line 4 (using Ctrl + Click)?

For the kivy.bat you can create custom run command in Settings->External Tools and find this command in Tools menu than.

Thank you very much.