DEV Community

Cover image for Creating a minimal python development environment under Windows
Samuel Viana
Samuel Viana

Posted on • Originally published at codehouse.digfish.org

Creating a minimal python development environment under Windows

This article explains how to get a minimal running Python environment under Windows. After exploring several alternatives, like using micromamba script which is based in anaconda, I went on researching to obtain a stripped version of Python to use as a stub for running non compiled code under Windows. Python.org has the embedded Python distribution on Windows (see download page). The 64-bit 3.11.8 version zip distribution is 11 MB (40 MB expanded). If you analyse its contents, you'll se binaries python and pythonw there. What you don't have is the pip executables, which you can add later. So, extract the python-x.y.z-embed-amd64.zip in a directory of your choice. In the extracted files, find the file pythonXy._pth which has the following contents:

pythonxyy.zip
.

# Uncomment to run site.main() automatically
#import site

Uncomment the last line and save the file. Download the script get-pip.py from https://bootstrap.pypa.io/get-pip.py and save it inside the python directory. Open a command line inside the directory and run python get-pip.py. When the execution fininshes, you should now have a running python environment ready to be used. Add the created Scripts directory to the front of your PATH environment variable :

set PATH=%CD%\scripts;%PATH%

to ensure you are running the right pip to install what you need. For example I like to install the pip_search module which provides the deprecated pip search functionality.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay