How to Build a Python Development Environment on Windows with Docker
This guide shows Windows users how to replace painful pip installations and VM setups by running an Ubuntu Docker container, installing essential tools and Python, customizing Vim, and committing a reusable image for seamless Python development.
Windows users often struggle with Python development due to pip errors and library installation issues.
Instead of using a VM, you can run an Ubuntu container on Windows with Docker to create a clean Python environment.
Prerequisites
Windows version that supports Hyper‑V (Windows 10 or later)
Enable Virtualization in BIOS
Install Docker for Windows
Download the installer from the official Docker site, run it, and verify the installation with docker --version.
Pull and run an Ubuntu image
Pull the Ubuntu 18.04 image and start a container:
docker pull ubuntu:18.04
docker run -it ubuntu:18.04 bashConfigure the container
Replace the default apt sources with a faster mirror, update the package list, and install common tools and Python 3.6:
apt update
apt install iputils-ping wget net-tools vim
apt install python3.6
ln -s /usr/bin/python3.6 /usr/bin/python
apt install python3-pipCustomize Vim
Create a ~/.vimrc with preferred settings (example shown).
Commit the customized image
Exit the container, list containers with docker ps -a, then commit the changes:
docker commit <container_id> shenzhongqiang/python-dev:version1Now you have a reusable image ( shenzhongqiang/python-dev:version1) that can be pulled and run directly:
docker pull shenzhongqiang/python-dev:version1
docker run -it shenzhongqiang/python-dev:version1 bashRemember to commit any further changes to keep the image up‑to‑date.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
