PYTHON ENVIRONMENT SPEEDRUN:

Requirements:

  • You must have a windows PC that was built after the year 1980.
  • You have to follow these instructions.
  • If you've already half-assed something and fucked up, I might not be able to save you.

IF YOU FUCK UP:

  1. You're going to need to burn everything down and start again. Don't try to make a "half-assed" environment work as a jank DIY "full-assed" environment.
  2. Hit the windows key, type "Add or Remove programs", press Enter
  3. Remove Microsoft Visual Studio Code, remove Python
  4. Delete your python folder if you made one (or save it somewhere else, or rename it to something else.)
  5. Follow the instructions again from step 1.

Instructions:

  1. Begin the speedrun
  • Start your timer. This is a speedrun. The goal is to set up Python on your PC as fast as humanly possible.
  1. Get python from python.org
  • Head to https://www.python.org/downloads/
  • Go to version "3.11.6" and download the "Windows installer (64-bit)" (or "3.12.0" if you want to deal with all of the dependency issues of the latest version, I don't care.)
  1. Install python on your PC
  • Execute the installer once downloaded
  • Double click on the installer
  • On the first screen, select "Add python.exe to PATH", then select "Install Now"
  1. Allow your PC to run scripts you write
  • Press the windows key on your PC
  • Type "Windows PowerShell". Right click and run as administrator.
  • Type "Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted" into powershell and hit enter. Enter "Y" to allow changes to be made.
  1. Download VSCode
  • Go to https://code.visualstudio.com/Download
  • Run VSCodeUserSetup-x64-\[version_number].exe
  • Click through the setup and get it running
  • When it opens for the first time, right click the icon on your taskbar and hit "pin to taskbar" so you don't lose it later
  • Hit Ctrl + Shift + X (Or go to the icon with the 4 blocks on the left). Type "Python". Hit "install" on the first option.
  1. Set up a virtual environment (venv)
  • Open file explorer
  • Go to some folder (preferably your documents folder or somewhere on your desktop) where you want to set up your environment.
  • Create a new folder named "python" or whatever the fuck you wanna name it.
  • Click on the bar that shows the current directory/path you're on. Type "cmd" and hit enter.
  • Type "mkdir projects", hit enter
  • Type "python -m venv venv", hit enter
  1. Open your venv in VSCode
  • Go back to VSCode. Hit Ctrl + K + O (Or go to File > Open Folder in the top left)
  • Head to the path of the folder on your desktop/documents page you created on step 6. Select the folder.
  • Hit Ctrl + Shift + P or find the "command pallet", type ">Python: Select Interpreter"
  • Select the option with a big shiny star directly next to it, the one labeled "Recommended".
  • Hit Ctrl + ~ on vscode. This is your terminal. There are many like it, but this one is yours.
  1. Create and run a python script
  • Create a new file inside of your "projects" folder named "hello.py".
  • Open the file in VSCode. Type print("hello world")
  • Hit the dropdown next to the play button on the top right. Hit "run python file."
  • hello world should print to the console. Success(?)
  1. (optional) Use ChatGPT to write code for you
  • (TIP): If you do not know how to write code in Python, ChatGPT can do it better and more efficiently than you can. Be an evil villain. Cheat on your homework. Get good grades.
  • Go to https://chat.openai.com/
  • Sign in, set up an account, whatever.
  • Prompt chatgpt to "write a python script that [does X thing]". If you don't know what you want to do, prompt chatgpt to "come up with 100 python script project ideas" and choose something random from that list.
  • If you want to actually learn how to use python, prompt chatgpt to "teach me about [X topic]" or "explain [X topic]" (where [X topic] is the first line of code that you do not understand). Read through the text carefully, and every time chatgpt says something that you are not intimately familiar with, recursively ask it to "explain [Y topic]". By the end of the day, you'll basically become a Wikipedia page for whatever topic you're interested in.
  1. (optional) Install pypi modules
  • (TIP): Pretty much every python project requires you to download a few external modules that do specific tasks.
  • Google "pypi [insert module name. e.g. "numpy", "PIL", "bs4", etc]". Click on the first result.
  • Copy the box that says "pip install [module index]". Paste that command it into your "(venv)" terminal and hit enter, then wait a few seconds for the library to download.
  • Once installed, you can now import the module into your script with "import [module name]"
Edit
Pub: 10 Nov 2023 21:48 UTC
Edit: 03 Sep 2024 05:44 UTC
Views: 159