Cloud Native 7 min read

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.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Build a Python Development Environment on Windows with Docker

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 bash

Configure 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-pip

Customize 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:version1

Now 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 bash

Remember to commit any further changes to keep the image up‑to‑date.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockercontainerizationDevelopment EnvironmentWindowsUbuntu
MaGe Linux Operations
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.