I couldn't point the environment to "kivy", but I changed an existing one to point to /usr/local/bin/kivy. This allows me to run the "hello world" kivy app. I'm guessing there is more to setup though for other libraries, etc.
Create a virtualenv. I couldn't figure out how to make it directly, so I made on from 2.7.1 and then edited it. I tried navigating to /usr/local/bin/kivy when I needed to choose the interpreter, but it didn't work.
It doesn't really matter what you name it. It just matters that you know which virtualenv is where.
Kivy is already its own virtualenv/custom python distribution (type the kivy cmd in a terminal, it's a python shell), so pycharm needs to look at /usr/local/bin/kivy instead of /Library/Frameworks/Python.framework/Versions/Current/bin/python (or whatever) for code inspections, libraries, eggs, etc.
Note that you must have run the make-symlinks script that came with the Kivy.app installer for this to work. If you didn't/can't run make-symlinks, try changing the path to kivy to /Applications/Kivy.app/Contents/Resources/script
2: Make sure Kivy is your project interpreter
After you create the kivy interpreter, set it as your kivy project interpreter in Preferences > Project Interpreter.
Apply and Ok, and confirm that the skeletons generate (or at least mostly, I had some errors) and that your project looks a bit like this:
Note that my python system library is horribly polluted, so if yours is clean it will look different.
3: Add .kv support
You can save Kivy Files.xml (949B) to this directory: ~/Library/Preferences/PyCharm20/filetypes/
I made it pretty quickly, it's missing a lot but at least it will color a lot of the main words.
4: Add a Run Config
Make a run config like normal, just make sure the Kivy interpter is selected so that pycharm will use /usr/local/bin/kivy instead of your standard python (/usr/bin/python or whatever)
Caveat Emptor: I just started the kivy tutorials myself, so I can't promose I did that totally correctly but it seems to work...
I'm also in the same situation as guest 06/04/13. Would be great to have support for kivy packages (so red underlining goes away and integrated source navigation etc), also would be great to support debugging experience with kivy apps.
I was able to create a tool in which manually launch my app easily (by going to Settings>External Tools and setting 1) Program to /usr/local/bin/kivy 2) Parameters to: path to my main.py file relative from 3) and 3) Working Directory... my complete working directory.)
It's sort of a stop gap... but, far short of what is required.
I followed the steps stated by Peter but still cannot successfully set project interpreter to Kivy 1.8. It prompted an error message "Invalid python interpreter name{0}!". I upgraded to pycharm 3.4 recently. What have I done wrong?
from kivy.properties import NumericProperty, ReferenceListProperty
1: Preferences > Project Interpreter > Python Interpreters
Create a virtualenv. I couldn't figure out how to make it directly, so I made on from 2.7.1 and then edited it. I tried navigating to /usr/local/bin/kivy when I needed to choose the interpreter, but it didn't work.
Edit Python Interpreter
Name: Kivy
Interpreter Path: /usr/local/bin/kivy
It doesn't really matter what you name it. It just matters that you know which virtualenv is where.
Kivy is already its own virtualenv/custom python distribution (type the kivy cmd in a terminal, it's a python shell), so pycharm needs to look at /usr/local/bin/kivy instead of /Library/Frameworks/Python.framework/Versions/Current/bin/python (or whatever) for code inspections, libraries, eggs, etc.
2: Make sure Kivy is your project interpreter
After you create the kivy interpreter, set it as your kivy project interpreter in Preferences > Project Interpreter.
Apply and Ok, and confirm that the skeletons generate (or at least mostly, I had some errors) and that your project looks a bit like this:
Note that my python system library is horribly polluted, so if yours is clean it will look different.
3: Add .kv support
You can save Kivy Files.xml (949B) to this directory: ~/Library/Preferences/PyCharm20/filetypes/
I made it pretty quickly, it's missing a lot but at least it will color a lot of the main words.
4: Add a Run Config
Make a run config like normal, just make sure the Kivy interpter is selected so that pycharm will use /usr/local/bin/kivy instead of your standard python (/usr/bin/python or whatever)
Caveat Emptor: I just started the kivy tutorials myself, so I can't promose I did that totally correctly but it seems to work...
it would be great to be able to work on Kivy apps in PyCharm!
I was able to create a tool in which manually launch my app easily (by going to Settings>External Tools and setting 1) Program to /usr/local/bin/kivy 2) Parameters to: path to my main.py file relative from 3) and 3) Working Directory... my complete working directory.)
It's sort of a stop gap... but, far short of what is required.
http://youtrack.jetbrains.com/issue/PY-8238
I'm getting the error...
/usr/local/bin/kivy /Users/user/Downloads/Cython-0.20.2/setupegg.py
Traceback (most recent call last):
File "/Users/user/Downloads/Cython-0.20.2/setupegg.py", line 4, in <module>
execfile('setup.py')
File "setup.py", line 25
ImportError: No module named kivy.app
^
SyntaxError: invalid syntax
Process finished with exit code 1
Does anyone have a fix?
P.S. Kivy scripts run if I open them with Kivy.app.