Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

python_setup_instructions

This document provides step-by-step instructions for setting up Python and Visual Studio Code (VS Code) on Windows and Mac. It emphasizes downloading the correct versions of Python, installing necessary extensions, and ensuring that pip is properly configured for package management. Troubleshooting tips and useful pip and Python commands are also included to assist users in resolving common issues.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

python_setup_instructions

This document provides step-by-step instructions for setting up Python and Visual Studio Code (VS Code) on Windows and Mac. It emphasizes downloading the correct versions of Python, installing necessary extensions, and ensuring that pip is properly configured for package management. Troubleshooting tips and useful pip and Python commands are also included to assist users in resolving common issues.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Python & VS Code setup instructions

1. Download Python
Download Python using the appropriate link below.

Windows: https://www.python.org/ftp/python/3.8.6/python-3.8.6-amd64.exe
Mac: https://www.python.org/ftp/python/3.8.6/python-3.8.6-macosx10.9.pkg

DO NOT INSTALL PYTHON FROM THE WINDOWS APP STORE (OR MAC APP STORE). IT WILL NOT
INSTALL EVERYTHING REQUIRED. THERE IS A REASON WE ARE GIVING YOU THIS LINK, PLEASE
USE IT!

Please do not install an alternative version of Python without checking with Mr Baumgarten. Our
dependencies require 64 bit and are not yet compatible for v3.9.

2. Install Python
● TICK THE BOX​ to add Python 3.8 to PATH - it will cause all sorts of headaches later if you don’t!
● Run the I​ NSTALL NOW​ option. Accept ALL DEFAULTS. Changing the defaults WILL CAUSE
PROBLEMS LATER. Trust us.
3. Download VS Code

Windows: https://vscode-update.azurewebsites.net/latest/win32-x64/stable/
Mac: https://vscode-update.azurewebsites.net/latest/darwin/stable/

4. Install VS Code
● When presented, please turn ON all these options

● “Launch VS Code” when offered at the end of the install, and move on to step 5.

5. Install VS Code extensions


Click the Extensions icon on the left side-bar as shown
In the search bar that appears, type python, and click the blue install button on the Python extension by
Microsoft as shown below.

When this info screen appears with the “disable” and “uninstall” buttons, it means the installation has
completed.

Click the Folder view icon on the left sidebar (the top one as highlighted below) and then click Open Folder.

Open the folder you want VS Code to save your project work in. The coloured bar running across the bottom
of VS Code will change from purple to blue when you have opened a folder successfully.
6. Install Python packages
Use VS Code to open a terminal session via the menu bar across the top.

In the Terminal Window, type ​pip -V ​… and you should get a line similar to the one below indicating pip is
installed.

If you get a message '​ pip' is not recognized as an internal or external command, operable program or batch
file​ then you have not installed Python correctly. Uninstall Python and do it again following the instructions
more carefully.

Once you know pip is working, install the Python packages required for your unit as follows:

For Digital Design Instalife unit, run

● pip install --user pillow imagetoolsmadeeasy

For Digital Design Robotics & drones unit, run

● pip install --user pillow imagetoolsmadeeasy djitellopy pycozmo

A large wall of text will appear as pip installs the packages. Provided the end of the text includes a message
that says, “Successfully installed” such as the screenshot below, you are safe to proceed. (you can ignore a
pip version warning). Type e ​ xit​ to close the terminal window.
7. Test everything works
Create a new file

In the editor area, type

print("Hello world")

Use the menu to select File / Save As

Make sure the filename ends in .py to tell VS Code this will be a Python file.

It might take a few seconds the first time, but once successfully saved you will get a green play button that
will run your code.
You should be ready to start the first lesson!
Troubleshooting

The main problem that occurs is students not installing the pip tool with Python, or installing a 32bit version
of Python. These are the Python defaults. They are required.

Some useful pip commands…

To check the version of pip and where it is installed


● pip -V
To install a package without using the cache
● pip install --no-cache-dir --user ​packagename
To force pip to reinstall a package when it doesn’t think it needs to
● pip install --upgrade --force-reinstall --user ​packagename
List all the packages installed
● pip list
Delete everything in the pip cache
● pip cache purge

Some useful Python commands

import sys, platform


print("Location: ",sys.executable)
print("Version: ",sys.version_info)
print("64 or 32: ",platform.architecture())

You might also like