Table of Contents
Install Python
You can find the installer for Python at Python.org. Make sure to download the latest version.
If you are on an older version of MacOS (Between versions 10.9 and 10.12), you may encounter some issues with Python. Please make sure your system is up to date with a supported version of MacOS, or download an older version of Python.
The installer for Python is fairly straightforward. In most cases, you can simply hit “Install Now” and proceed, but please be certain to read the menus carefully as you go through the installer.
Note for MacOS
You may be prompted at the end of the installation process to install some SSL Certificates. You can do this by clicking on the link for “the Finder Window” on the screen, which will take you to a folder where you can execute “Install Certificates.command“. This will handle the certificate installation.
Install Visual Studio Code
Find the installer for VSCode for your system from the Visual Studio Code website.
Follow the steps in the installer.
Configure your Development Environment
Open your Workspace
- Open Visual Studio Code
- Along the left side of the screen, look for the “Files” icon.
- Click “Open Folder” and locate and select the folder you’ll want to run your code out of.
- You may be prompted to trust the authors of files in the folder. Click “Yes, I trust the authors”
- You may be prompted to trust the authors of files in the folder. Click “Yes, I trust the authors”
Enable Python Extensions
- On Windows, choose the File Menu. On MacOS, choose the Code menu.
- Choose Preferences, then select Extensions
- Scroll through the list, and click the Install button for Python
- If you are prompted to install Command Line Developer Tools on MacOS, it may say it will run for an incredibly long amount of time. Click away from the screen (do NOT hit “stop”) and continue on. It will run in the background and usually complete within 20 minutes.
- If you are prompted to install Command Line Developer Tools on MacOS, it may say it will run for an incredibly long amount of time. Click away from the screen (do NOT hit “stop”) and continue on. It will run in the background and usually complete within 20 minutes.
- Once the Extensions are installed, you may be prompted to select your Python Interpreter.
- If you do not see this prompt, you can still open the Python Interpreter option
- Press CONTROL+SHIFT+P which will open the preferences command. On MacOs type ⌘ + shift + P.
- Type python interpreter, and choose Python: Select Interpreter.
- Choose the interpreter for your environment (the path may vary)
Disable Inherit Environment (MacOS Only)
Inherit Environment will cause myriad issues in VSCode on MacOS, causing it to not recognize the correct Python interpreter.
- While VSCode is open, go to the Code menu and select Preferences and then Settings.
- Type Inherit env in the search bar.
- Look for “Terminal > Integrated: Inherit Env“
- If this is checked, please uncheck it.
- Restart VSCode by Quitting the application. This can be achieved by going to the Code menu and choosing Quit. Reopen the application afterward.
Set your Shell Profile
On Windows, VScode will want to use Powershell, which doesn’t really run Python well.
For Mac Users, you likely will not need to do this. If you do need to, you can follow these steps, but you will be changing bash to zsh.
- Click on the down arrow by the + on the right of the Terminal window
- Click Select Default Profile
- When the default profile options at the top open, choose command prompt
Mac Users: Choose zsh - Click the + sign by the terminal window, and it should open a new CMD line terminal, which should allow you to execute your Python code.
- (Optional) Click the Trashcan by the old terminal to close it
You’re Ready!
Now that this is all done, your environment should be configured and ready to go!