Install Python Once, Automate Forever: A Windows Setup Guide
From Python installation to Task Scheduler, and production-ready background scripts.
Install Python Once, Automate Forever: A Windows Setup Guide
From Python installation to Task Scheduler, and production-ready background scripts.

Installing Python on Windows sounds simple — until your script works locally but fails in production, scheduled jobs don’t run, or libraries mysteriously go missing.
If you’ve ever struggled with:
- Python not being detected in Command Prompt
pipinstalling packages in the wrong Python version- Scripts failing silently in Windows Task Scheduler
— you’re not alone.
This guide walks you through a production-ready Python setup on Windows, starting from installation and verification to installing the exact libraries your automation needs. We’ll also cover common pitfalls, package fixes, and finally set up Windows Task Scheduler to run your Python scripts reliably in the background.
By the end of this article, you’ll have a stable, repeatable setup that just works — even after system restarts.
Install and setup python
Step 1: Download Python Installer
Go to the official Python website:https://www.python.org/downloads/windows/

Click “Download Python” (or latest version)
Step 2: Run the Installer (IMPORTANT SETTINGS)
When the installer opens:
Check these boxes before clicking “Install”:
- Add Python to PATH (very important!)
- Click Customize installation

Then, in the next screens:
- Keep everything checked

- Enable: “Install for all users” “Precompile standard library”
- Choose install location: Example: C:\Python312 (or leave the default)

Click Install

Step 3: Verify Installation
After install finishes:
Open Command Prompt
Run: where python
You should now see something like:
C:\Python312\python.exe
C:\Python312\Scripts\python.exe

This means Python is now properly installed.
Install Necessary Modules
Run this in Command Prompt
python -m pip install watchdog

This ensures you’re installing watchdog into that exact Python which Task Scheduler is using.
python -m pip install pandas

Verify it is installed
python -m pip show watchdog
You should see:
Name: watchdog
Version: x.y.z
Location: C:\Python312\Lib\site-packages

python -m pip show pandas
You should see:
Name: pandas
Version: x.y.z
Location: C:\Python312\Lib\site-packages

Update the paths in Python File to Run the Script
Update the below path in the scripts
run_script.bat
@echo off
cd /d C:\Script
echo Running script at %date% %time% >> run_script.log
python script.py >> run_script.log 2>&1
echo Finished at %date% %time% >> run_script.log
Set Up Task Scheduler on Windows
Open Task Scheduler
- Press Win + R → type taskschd.msc → Enter

Create a New Task
- In the right pane, click “Create Task…”

General Tab
- Name: ScheduleScript
- Description: description
- Run whether user is logged on or not
- Run with highest privileges

Triggers Tab
- Click New…
- Begin the task: At startup
- Enabled: tick


Click OK


Actions Tab
- Click New…
- Action: Start a program
- Program/script: C:\Path\To\Your\run_script.bat


Click OK


Conditions Tab
- Uncheck Start the task only if the computer is on AC power and Start the task only if idle

Settings Tab
- Check:Allow task to be run on demand
- Allow task to be run on demand
- Restart if fails
- If the task is already running, then the following rule applies: Do not start a new instance
Click OK

Enter Admin Password (if prompted)
Task will be saved and ready.

Restart the System
Setting up Python correctly on Windows is less about clicking “Install” and more about doing it the right way once.
In this guide, we:
- Installed Python with the correct PATH and system-wide settings
- Ensured all required libraries were installed in the same Python environment
- Fixed known package issues that can break automation
- Configured Windows Task Scheduler for reliable, background execution
This setup is ideal for data extraction jobs, monitoring scripts, ETL pipelines, and long-running background tasks that must run without manual intervention.
Once configured, you can focus on what your script does, not on why it stopped working.
메타데이터
- post_id
- 4febdbc74fd9
- slug
- install-python-once-automate-forever-a-windows-setup-guide-4febdbc74fd9
- url
- https://medium.com/@drishigupta/install-python-once-automate-forever-a-windows-setup-guide-4febdbc74fd9
- canonical_url
- https://medium.com/@drishigupta/install-python-once-automate-forever-a-windows-setup-guide-4febdbc74fd9
- author_url
- https://medium.com/@drishigupta
- status
- ok
- fetched_at
- 2026-08-18 19:19:32