Course: CIT 411
Audience: Future CIT 411 students with little or no command-line experience
Goal: Install Python, configure VS Code, create a virtual environment, and run a working “Hello World” script on Windows or macOS.
- What You Will Install
- Before You Start
- Windows Installation
- macOS Installation
- Install and Configure VS Code
- Create a Project and Virtual Environment
- Hello World Verification Script
- Recommended VS Code Shortcuts and Settings
- Common Errors and Troubleshooting
- Next Steps
- Final Verification Checklist
By the end of this guide, your computer should have:
- Python 3 installed
- Visual Studio Code installed
- VS Code Python extension installed
- VS Code Pylance extension installed
- A working project folder
- A Python virtual environment
- A successful
hello.pytest script
Python is the programming language. VS Code is the editor where you will write and run code. A virtual environment keeps each project’s Python packages separate so one class project does not accidentally break another.
- A Windows 10/11 computer or a macOS computer
- Administrator permission to install software
- Internet access
- About 30–45 minutes
- A GitHub repository for your final submission
Use a simple folder path with no special characters:
Windows
C:\Users\YourName\Documents\cit411-python-setup
macOS
/Users/YourName/Documents/cit411-python-setup
Avoid saving your first project inside OneDrive, iCloud Drive, Dropbox, or Google Drive. Cloud-sync folders sometimes lock files while Python or VS Code is trying to use them.
- Open your browser.
- Go to the official Python download page: https://www.python.org/downloads/
- Click the button for the latest Python 3 release.
- Download the Windows installer (64-bit).
Decision point:
Use the official Python website, not a random download site. This reduces the risk of installing an outdated or unsafe package.
- Open the downloaded
.exeinstaller. - On the first installer screen, check:
Add python.exe to PATH
- Click Install Now.
Important:
This is one of the most common places students make a mistake. If you do not check Add python.exe to PATH, Windows may not recognize the python command in PowerShell.
When the installer finishes, click Close.
- Open PowerShell.
- Run:
python --versionYou should see output similar to:
Python 3.x.x
Then run:
pip --versionYou should see output similar to:
pip 25.x from ... (python 3.x)
If this works, Python is installed correctly.
- Open your browser.
- Go to the official Python download page: https://www.python.org/downloads/
- Click the latest Python 3 release.
- Download the macOS 64-bit universal2 installer if it is available.
Decision point:
macOS may already include a system Python, but do not rely on it for class projects. Install the current Python 3 version from python.org.
- Open the downloaded
.pkgfile. - Click Continue through the installer screens.
- Accept the license agreement.
- Choose the default install location.
- Click Install.
- Enter your Mac password if prompted.
- Open Terminal.
- Run:
python3 --versionYou should see:
Python 3.x.x
Then run:
pip3 --versionYou should see:
pip 25.x from ... (python 3.x)
Note:
On macOS, the command is usually python3, not python.
- Go to: https://code.visualstudio.com/
- Download VS Code for your operating system.
- Install it using the default options.
- Open VS Code.
- Click the Extensions icon on the left sidebar.
- Search for:
Python
- Install the official Python extension from Microsoft.
- In the Extensions search bar, search:
Pylance
- Install the official Pylance extension from Microsoft.
Pylance gives better autocomplete, code analysis, and type-checking support.
- In the Extensions search bar, search:
Black Formatter
- Install the official Black Formatter extension from Microsoft.
Black automatically formats Python code in a consistent style.
- In VS Code, click File > Open Folder.
- Create or select this folder:
Windows
Documents\cit411-python-setup
macOS
Documents/cit411-python-setup
- Click Select Folder or Open.
A virtual environment is a private Python workspace for one project. It helps avoid package conflicts.
In VS Code, open the terminal:
Terminal > New Terminal
Run:
python -m venv .venvRun:
python3 -m venv .venvThis creates a hidden folder named .venv.
Run:
.\.venv\Scripts\Activate.ps1If activation works, your terminal prompt should begin with:
(.venv)
Run:
source .venv/bin/activateIf activation works, your terminal prompt should begin with:
(.venv)
- Press:
Windows
Ctrl + Shift + P
macOS
Command + Shift + P
- Search for:
Python: Select Interpreter
- Choose the interpreter inside
.venv.
It should look similar to:
Windows
.\.venv\Scripts\python.exe
macOS
./.venv/bin/python
Decision point:
Do not select the global Python interpreter if your .venv interpreter is available. For class projects, use the .venv interpreter.
In your project folder, create a file named:
hello.py
Copy this code into hello.py:
import platform
import sys
from datetime import datetime
def main() -> None:
print("Hello, CIT 411!")
print(f"Python executable: {sys.executable}")
print(f"Python version: {platform.python_version()}")
print(f"Operating system: {platform.system()} {platform.release()}")
print(f"Verification time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
if __name__ == "__main__":
main()Make sure your virtual environment is active, then run:
python hello.pyMake sure your virtual environment is active, then run:
python hello.pyor:
python3 hello.pyExpected output should look similar to:
Hello, CIT 411!
Python executable: C:\Users\YourName\Documents\cit411-python-setup\.venv\Scripts\python.exe
Python version: 3.x.x
Operating system: Windows 11
Verification time: 2026-05-16 14:30:00
On macOS, the Python executable path will look different:
/Users/YourName/Documents/cit411-python-setup/.venv/bin/python
If your output shows the .venv path, your setup is working end-to-end.
| Action | Windows | macOS |
|---|---|---|
| Open Command Palette | Ctrl + Shift + P |
Command + Shift + P |
| Open Terminal | Ctrl + ` |
Control + ` |
| Save File | Ctrl + S |
Command + S |
| Format Document | Shift + Alt + F |
Shift + Option + F |
| Quick Open File | Ctrl + P |
Command + P |
| Toggle Sidebar | Ctrl + B |
Command + B |
| Run Python File | Right-click file > Run Python File in Terminal | Right-click file > Run Python File in Terminal |
Open Command Palette and search:
Preferences: Open User Settings (JSON)
Add or update the following settings:
{
"editor.formatOnSave": true,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"files.autoSave": "afterDelay",
"python.analysis.typeCheckingMode": "basic",
"python.defaultInterpreterPath": ".venv/bin/python",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.defaultProfile.osx": "zsh"
}If you are on Windows and VS Code does not automatically find your .venv, use this path instead:
"python.defaultInterpreterPath": ".venv\\Scripts\\python.exe"Where it happens: Windows PowerShell
Cause: Python was not added to PATH during installation.
Fix:
- Re-run the Python installer.
- Choose Modify.
- Make sure Add Python to environment variables is enabled.
- Finish the installer.
- Close and reopen PowerShell.
- Run:
python --versionWhere it happens: macOS Terminal
Cause: macOS often uses python3 instead of python.
Fix:
Run:
python3 --versionUse this command to create your virtual environment:
python3 -m venv .venvWhere it happens: Windows PowerShell when activating .venv
Error may look like:
Activate.ps1 cannot be loaded because running scripts is disabled on this system.
Cause: Windows PowerShell execution policy blocks activation scripts.
Fix:
Run this command in PowerShell:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserThen try again:
.\.venv\Scripts\Activate.ps1Where it happens: VS Code
Symptom: Your script runs, but the output does not show the .venv path.
Cause: VS Code is using the global Python interpreter instead of your virtual environment.
Fix:
- Press
Ctrl + Shift + Pon Windows orCommand + Shift + Pon macOS. - Search Python: Select Interpreter.
- Choose the interpreter inside
.venv. - Re-run
hello.py.
Where it happens: Running Python files after installing a package
Cause: You installed a package globally or in a different environment.
Fix:
- Activate your virtual environment.
- Confirm the Python executable:
python -c "import sys; print(sys.executable)"- Install the package again while
.venvis active:
python -m pip install package-nameReplace package-name with the package required by your assignment.
Where it happens: VS Code format command
Cause: Black Formatter extension is missing or not selected.
Fix:
- Install the Black Formatter extension from Microsoft.
- Open Settings JSON.
- Confirm:
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}- Save the file and restart VS Code.
Where it happens: Windows or macOS terminal
Cause: You are in the wrong folder or used the wrong activation command.
Fix:
Check that .venv exists:
dirThen activate:
.\.venv\Scripts\Activate.ps1ls -laThen activate:
source .venv/bin/activateAfter your setup works, continue with these official and beginner-friendly resources.
- Python documentation home: https://docs.python.org/3/
- Python tutorial: https://docs.python.org/3/tutorial/
- Virtual environments and packages: https://docs.python.org/3/tutorial/venv.html
venvlibrary reference: https://docs.python.org/3/library/venv.html
- VS Code Python documentation: https://code.visualstudio.com/docs/python/python-tutorial
- Python formatting in VS Code: https://code.visualstudio.com/docs/python/formatting
- Python settings reference: https://code.visualstudio.com/docs/python/settings-reference
- Installing Python: https://realpython.com/installing-python/
- Python Basics tutorials: https://realpython.com/tutorials/basics/
- Setting Up Python course: https://realpython.com/courses/setting-up-python/
A student who follows this guide should be able to install Python, configure VS Code, activate a virtual environment, and run the verification script without needing extra help.


