Home » Tools and Tech Stack » Setting Up Python & VS Code for SEO

Setting Up Python & VS Code for SEO

Published on

Updated on

Python and VS Code for SEO featured image

You have a CSV with 500,000 rows, VLOOKUP is taking a coffee break, and your RAM is screaming.

The shift from “SEO Specialist” to “SEO Engineer” starts with the toolset. You need a hammer that doesn’t break when you hit a big problem. That hammer is Python, and your workbench is VS Code.

This isn’t a computer science lecture, but a bloat-free setup you need to start running crawls, analyzing log files, and querying APIs.

Step 1: Install the Engine (Python)

Python is the language. It’s clean, it reads like English, and it has the best libraries for data analysis.

  1. Go to python.org and download the latest version (currently 3.12+).
  2. Run the installer. Then, STOP. Look at the bottom of the installation window. You will see a box that says “Add Python.exe to PATH”.
    • Check this box. * If you miss this, your terminal won’t know where Python is, and you will have a bad time.
  3. Click “Customize Installation” and make sure you download debugging symbols and binaries, as well as the free-thread binaries.
  4. Then click “Install”.
  5. Open your computer’s terminal (Command Prompt on Windows, Terminal on Mac) and type this: python –version

Here’s a nice walkthrough to get you started.

How to Add Python to PATH Manually?

You forgot to add Python.exe to PATH while rushing to your first automation experiment, right?

Don’t worry, the same thing happened to me. I got you covered.

  1. Locate your Python installation directory. A Typical example is: C:\Users\YourName\AppData\Local\Programs\Python\Python311
  2. Copy the following two locations:
    • The main installation folder (for example, C:\Users\YourName\AppData\Local\Programs\Python\Python311)
    • The Scripts folder inside it (for example, \Scripts)
  3. Modify your environment variables:
    • Open the Start menu and search for Environment Variables.
    • Select Edit the system environment variables.
    • Choose Environment Variables.
    • Under System variables, locate Path and select Edit.
    • Click New and add each of the copied paths.
  4. Save your changes and restart your terminal.

Finally, open a new command prompt and try running python –version. If the setup is correct, your installed Python version will be displayed.

Step 2: The Cockpit (Visual Studio Code)

You can write code in Notepad, but you shouldn’t. You need VS Code.

It’s lightweight, free, and has an ecosystem of extensions that make you look like a genius.

  1. Grab it from code.visualstudio.com.
  2. Standard installation. Nothing tricky here.
  3. Open VS Code and on the left sidebar, click the “Extensions” icon (the four squares). Search for and install these:
    • Python (by Microsoft) – Essential. Gives you code completion and debugging.
    • Jupyter – Allows you to run “Notebooks” (.ipynb files). This is crucial for data analysis where you want to see charts and dataframes inline, block by block.
The VS Code Extensions dashboard.

Step 3: The Sandbox (Virtual Environments)

This is the step most tutorials skip, and it’s why beginners break their setup.

You do not want to install libraries globally on your computer. You want to create a specific “box” for your project so dependencies don’t conflict.

This is called a Virtual Environment (venv).

  1. Create a folder on your desktop and name it whatever you want.
  2. Open VS Code, go to File > Open Folder, and select your new folder.
  3. In VS Code, hit or Terminal > New Terminal. You typically want to use Command Prompt (cmd) on Windows or zsh on Mac.
  4. Type this into the terminal: python -m venv venv (You’ll see a new folder named venv appear in your file explorer.)
  5. Activate It:
    • Windows: .\venv\Scripts\activate
    • Mac/Linux: source venv/bin/activate
The terminal menu in VS Code.

If you get a “running scripts is disabled” error on Windows:

  • Start PowerShell as Administrator and run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  • Then, try to activate venv again.

Success: You should see (venv) appear in green parentheses at the start of your terminal line. You are now in the matrix.

Step 4: Equipping the Automaton (Libraries)

Python is great, but the Libraries are where the magic happens. We need to install the “Big Three” using pip (Python’s package manager).

  • requests – Allows you to ping URLs and get status codes.
  • beautifulsoup – Allows you to scrape HTML and extract data (H1s, titles) (Just for basics, you’ll eventually move to more advanced libraries).
  • pandas – The Excel killer. Allows you to manipulate massive datasets in milliseconds.

You will fall in love with Pandas and Requests. In your activated terminal, run: pip install requests pandas beautifulsoup4

Step 5: “Hello World” (The SEO Version)

Let’s write your first script. We aren’t going to print “Hello World.” We are going to check a server status.

  1. Create a new file in VS Code named status_checker.py.
  2. Paste this code:
import requests

# Define the target
url = "https://seo-automata.com"

try:
    # Send a GET request (like a browser)
    response = requests.get(url)
    
    # Check the status code
    if response.status_code == 200:
        print(f"✅ Success! {url} is live (Status: 200).")
    else:
        print(f"⚠️ Issue detected. Status Code: {response.status_code}")

except Exception as e:
    print(f"❌ Connection failed: {e}")
  1. Run it via the terminal, just type: python status_checker.py

If you see the green checkmark, congratulations. You just wrote a script that went out to the internet, knocked on a server’s door, and reported back.

What’s Next?

You now have the engine installed, the cockpit configured, and your first successful ping logged in the terminal. You’ve officially moved past the “spreadsheet manager” stage and into the development environment.

This setup, Python, VS Code, and a clean virtual environment, is the exact same foundation used to build enterprise crawlers, automate log analysis, and train custom LLM models.

The constraints of Excel rows and manual clicking are gone. From here on out, if you can logic it, you can build it.


Discover more from SEO Automata by Preslav Atanasov

Subscribe now to keep reading and get access to the full archive.

Continue reading