How to configure Python Kivy for PyCharm on Windows?

前端 未结 7 792
孤独总比滥情好
孤独总比滥情好 2020-11-27 16:58

I\'m having trouble getting Kivy to work with PyCharm on Windows 7. I\'ve managed to add most of the external libraries through File > Settings > Python interpreters &

7条回答
  •  一个人的身影
    2020-11-27 17:49

    This Kivy's Wiki page Setting Up Kivy with various popular IDE's has a better answer and detail commands. It is copied below with added information for Pycharm 3.4.

    Go to your unzipped Kivy folder, create a symbol link for "kivy.bat" pointing to "python.bat" in the same directory (mklink python.bat kivy.bat).

    Add 2 new Python interpreters in PyCharm.

    • Bootstrapper: Choose the earlier created "python.bat" from the Kivy package folder.
    • Project Interpreter: Choose the "python.exe" from the Python subdirectory in the Kivy package folder.

    For the project interpreter, add a path to the "kivy" directory directly contained in the Kivy package folder. In PyCharm 3.4, the path tab is hidden in a sub menu. In Project Interpreter, click the tool icon next to the interpreter dropdown list, click more... (the last one), in the list of all project interpreters, select Run-Configuration Interpreter, on the right side there are five icons (+, -, edit, virtual env, and path), click path to add the Kivy sub-directory in unzipped Kivy folder.

    Save all settings and ignore warnings about "Invalid output format". Make sure that the project interpreter is set to our earlier created configuration.

    Create a new run configuration and set the Python interpreter to our earlier created bootstrapper.

    Simply run the configuration to execute your Kivy application

提交回复
热议问题