Setting up Pycharm on OSX (older versions) - darkopevec/kivy GitHub Wiki
Installing PyCharm for Kivy (older versions)
This page stores instructions for installing older version of PyCharm and Kivy, kept for the sake of completeness. These version are no longer supported and we strongly recommend you use the latest versions of both. Instruction for the current versions can be found here.
Setting up Kivy 1.8 with PyCharm 4 on OS/X
-
Open your project in PyCharm
-
Run -> Edit Configurations -> Environment Variables

-
Add entries for the several required variables.

-
If you have a non-standard installation, you can get the updated environment variables by running the kivy script interactively:

Setting up Kivy 1.9.0 with PyCharm 4.5 EAP on OS X 10.10.3
-
Install Kivy 1.9.0
We assume you have copied the
Kivy.appfolder as found in Kivy-1.9.0-rev3-osx.dmg into the/Applicationsfolder. -
Make kivy known to PyCharm
Add a link to the kivy package in the
site-packagesfolder of the interpreter that kivy uses:
cd /Applications/Kivy.app/Contents/Resources/venv/lib/python2.7/site-packages
ln -s /Applications/Kivy.app/Contents/Resources/kivy/kivy kivy
PyCharm scans the site-packages folder to help you with auto-complete.
We'll check this in a later step.
-
Configure a Project Interpreter
-
Start PyCharm.
-
Close any project you may have open (
File->Close Project). -
At the bottom of the Welcome screen, choose
Configure -> Preferences. (Alternatively, pressCMD-,). -
In the Default Preferences window, choose
Default Project -> Project Interpreter.
Click theclogicon in the upper right corner, and in the drop-down list, chooseMore...
In the Project Interpreters window, click theplusicon, and in the drop-down list, chooseAdd Local. -
In the Select Python Interpreter window, delete the path of the currently selected python interpreter (in my case, this was /usr/bin/python) and navigate to (or copy that path into the address bar):
/Applications/Kivy.app/Contents/Resources/python-
Click
OKto close the Select Python Interpreter window.
Optional: give the interpreter a nicer name, by clicking thepencilicon in the Project Interpreters window: in the Edit Python Interpreter window'sNamefield, add 'KIVY' between 'Python' and '2.7.6'. This will make the kivy interpreter more easily recognizable later on. -
Click
OKto close the Project Interpreters window. -
Click
Applyat the bottom of the Default Preferences window. -
Click
OKto close the Default Preferences window.
-
-
Set the interpreter of your project
- Either open a project you already created, or create a new one. Here, I will create a new one (a Pure Python project).
- In the pane that appears after choosing
New Project, in the drop-down list that accompanies theInterpreterfield, select the KIVY interpreter we created in the preceding step.
Click theCreatebutton. - If you chose to open an existing project: open up the
PyCharm-EAP->Preferences...menu in the main menu (or useCMD-,); in the Preferences window chooseProject: *your_existing_project*->Project Interpreterand use the drop-down list to select the KIVY interpreter. ClickApplyand then clickOK.
-
Check that auto-complete works
Create a new Python file in your project and start typing, e.g. let's begin with an import:
import kivand note the pop-up. Yay! -
Configure a Run/Debug configuration
From the main menu bar of PyCharm, choose
Run->Edit Configurations...-
In the Run/Debug Configurations, click the
plusicon (or, use the keyboard shortcutCMD-N), and choosePythonfrom the drop-down list to create a new configuration.
Note that thePython interpreterfield already shows the KIVY interpreter filled in. -
Fill out the
Name,Script, and other fields you would normally need to fill. -
Click the
ellipsisicon (...) that accompanies theEnvironment variablesfield. -
In the Environment Variables field, use the
plusicon orCMD-Nkeyboard short-cut to add the following environment variables -- as found in/Applications/Kivy.app/Contents/Resources/script-- (you can copy the whole block and paste it with theclipboardicon):
-
PYTHONPATH=/Applications/Kivy.app/Contents/Resources/kivy:${PYTHONPATH}
GST_PLUGIN_SCANNER=/Applications/Kivy.app/Contents/Resources/gst-plugin-scanner
GIO_EXTRA_MODULES=/Applications/Kivy.app/Contents/Frameworks/GStreamer.framework/Versions/Current/lib/gio/modules
LD_PRELOAD_PATH=/Applications/Kivy.app/Contents/Resources/lib
GST_PLUGIN_SYSTEM_PATH=/Applications/Kivy.app/Contents/Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0
KIVY_HOME=/Applications/Kivy.app/Contents/Resources/.kivy
GTK_PATH=/Applications/Kivy.app/Contents/Frameworks/GStreamer.framework/Versions/Current
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Kivy.app/Contents/Resources/lib
GST_REGISTRY=/Applications/Kivy.app/Contents/Resources/gst.registry
Note: because of the link we created in the site-packages folder, I think the PYTHONPATH adaptation is not needed (need to check)
Note: I filed an issue with respect to seemingly non-existing ${SCRIPT_PATH}/lib folder usage
Note: I'm not sure if KIVY_HOME is somehow overridden to be ${USER}/.kivy where I find my Kivy configuration settings and log files.
* Finally click the `Apply` button and then the `OK` button in the _Run/Debug Configurations_ window.