If you want to use your own PC or laptop for MAS2008, you should follow
the steps below (which are also covered in this
YouTube video).
For the sake of example, I will assume that your name is Pat.
Double-click the downloaded file to install Python. Important: when the installer starts, click the box marked "Add python.exe to PATH". Apart from that, accept all default options.
Double-click the downloaded file to install VS Code. Accept all default options.
Download this file: requirements.txt. Save it in
C:\Users\Pat\Documents\Python.
Start VS Code
From the top menu, select File, then Open Folder.
This will pop up a box in which you can navigate to C:\Users\Pat\Documents and
select Python.
From the top menu, select Terminal, and then New terminal.
This will create a new area at the bottom of the VS Code window where you can enter commands.
In the terminal area, type python -m pip install --upgrade pip.
This should only take a few seconds to complete.
In the terminal area, type pip install -r requirements.txt.
This will install a long list of Python packages that will be needed later in
the course. (It would also be possible to install them individually as needed,
but that would be less efficient.) The installation process may take quite a while.
Click the extensions icon () on
the left of the VS Code window.
In the extension search box at the top left, enter Pylance, then
press Enter. This will install the Pylance extension and various
other associated extensions, all of which are useful when editing
Python code.
In the extension search box at the top left, enter Jupyter, then
press Enter. This will install an extension to help with editing
Jupyter notebooks. (Note that Jupyter is spelled with a y and
not an i here.)
Repeat the above step to install the
"British English - Code Spell Checker" extension.
(This will be useful later in the semester when you need to write
assignment reports which will contain a lot of text as well as code.)
Assuming that you opened the folder
C:\Users\Pat\Documents\Python as described above,
you should see the folder name PYTHON at the top left.
Click on it, then click on the New File icon that
appears next to it, then enter hello.ipynb as the
file name.
Enter print("Hello World!")
in the space
that appears as a result of the previous step, then type
SHIFT-ENTER. You will probably then be asked to choose a Python
interpreter, but there will probably only be one choice, so you
should click it. The message Hello World! should then appear.
Adding Python to PATH
If you followed the instructions exactly as above, then the location of Python
will have been added to your PATH environment variable. That means that Windows
will know where to look for Python if you execute pip or
python in a terminal window. However, if you installed Python in
some other way, it may not have been added to PATH and you might see messages like
this:
'python' is not recognized as an internal or external command, operable program
or batch file.
If so, you can add Python to your PATH manually by following
these instructions
(or you could ask Google Gemini how to do it).
Alternatives
There are various other ways you could set up Python and VS Code, for example
by using Anaconda. You could also use a different integrated development
environment instead of VS Code if you prefer. However:
Assignments must be submitted as Jupyter notebooks (i.e.
.ipynb files) so whatever framework you use must support that.
I will do my best to resolve any problems that arise if you use the recommended
framework, but I make no guarantees if you are using some other framework.