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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay