Software Setup - CP1404/Starter GitHub Wiki
Software Setup
CP1401/5639 - Programming 1
Students in CP1401 ONLY need Python 3 and PyCharm:
-
Download and install Python 3 from: https://www.python.org/downloads/
(Windows) Choose the option Add Python to PATH when you install. -
Install PyCharm
- Download and install PyCharm. You do not need the Pro subscription.
- That's it. You do not need to install Kivy or Git.
CP1404 - Programming 2
Students in Programming 2 need the following installed:
- Python (3.9+)
- PyCharm
- Kivy (2.0+) - note that Kivy < 2.0 is not compatible with Python > 3.7
- Git
Each of these tools have their own instructions available online, but this guide is an attempt to compile all of the basic details you require in one place.
Things change and your system might be different, and sometimes you'll find a different/better way is needed.
GitHub:
If you do not have one already, create a GitHub account.
Go to https://github.com and sign up with your JCU email address. Be sure to use a username that easily identifies you.
Note: GitHub do not accept our my.jcu.edu.au addresses as student proof because non-student alumni also have these addresses.
So, in the following step, please choose the option that lets you upload proof, and upload a photo of your current student ID card with the date on it.
Go to https://education.github.com/discount_requests/new and enter your details so you can get free private repositories and your GitHub 'pack' with a bunch of free bonuses: http://education.github.com/pack
Git:
Download and install git from https://git-scm.com/download
There are a number of options for things like git-bash and what console you want to use... All of the defaults should be fine.
Python:
Download and install Python 3 from: https://www.python.org/downloads/
Choose the option Add Python to PATH when you install.
The Windows default location can be hard to find, so I recommend changing this to something more obvious and memorable like C:\Python
. Choose to customise your installation:
PyCharm:
After you have installed Python...
Currently, JetBrains doesn't accept my.jcu.edu.au
addresses as proof of student status. If you would like the Pro versions of JetBrains software, you will probably need to provide official documentation, not just your email address:
- Sign up for a free JetBrains account at: https://www.jetbrains.com/shop/eform/students using your JCU email address.
- Download and install PyCharm: https://www.jetbrains.com/pycharm/download/index.html
Enter your new account details when asked in PyCharm installation/setup.
Kivy:
Kivy is a Python package, and you can install it and any other packages via PyCharm. First, create a new PyCharm project and select the previously configured interpreter, NOT a virtual environment.
Note: If you know what you're doing using a Virtual Environment, or are keen to learn, then you are welcome to use one. The reason it is suggested to use the system interpreter instead of a virtualenv is due to students not understanding what venvs are and then not being able to access packages they installed.
Click the dots ("meatball menu") to choose a new interpreter and select the System Interpreter you installed earlier. (This is why it's useful to install Python in a directory you can find.)
When your new project loads, you can install the Kivy package as you would any Python package via PyCharm: File > Settings > Project > Interpreter (you should see your current system interpreter), then click the + button, search for and install "Kivy").
Add KV language auto-completion and syntax highlighting. This is needed because PyCharm does not know about KV language by default:
- Download this file https://github.com/Zen-CODE/kivybits/blob/master/IDE/PyCharm_kv_completion.jar?raw=true
- On PyCharm’s File menu, import the settings: File > Manage IDE Settings > Import Settings... or File > Import (depending on your OS)
- Select the .jar file you just downloaded and click OK on the dialog with file types ticked.
- Restart PyCharm.
Test Your Setup
To test it's all working, create a PyCharm project (if you haven't already), making sure to select the interpreter where you installed Kivy.
Create a new Python file, and enter the code from https://github.com/CP1404/Starter/blob/master/check_setup.py (or download this file to your project folder.
Run it by right-clicking in the code window and choosing "Run..."
If it works, you should see a nice big hello world
button.
Celebrate!
You can also test your Git & GitHub setup by using PyCharm to clone a repository and run the code:
Select VCS > Get from Version Control > GitHub
Then login with your GitHub credentials.
Enter our starter repo URL: https://github.com/CP1404/Starter
in the prompt, clone it to a new folder and open this as a new project.
If you need help, please ask.
Advanced
If you get an error like the following when using pylint
with Kivy code:
Kivy: Instance of 'Button' has no 'bind' member
This means that pylint is not able to find the bind method because it comes from cython code.
Set pylint configuration to check this code. See Stack Overflow Q&A
If you don't have a .pylintrc
file, create one with the terminal command:
pylint --generate-rcfile > ~/.pylintrc
Edit the file, find the line with 'whitelist', and change it to:
extension-pkg-whitelist=kivy