---
slug: "ubuntu-python-venv-error"
title: "When python3.6 -m venv Errors Occur on Ubuntu"
description: "If `python3.6 -m venv venv` fails on Ubuntu, the `python3.6-venv` package is missing — install it via apt to enable virtual environment creation."
url: "https://www.ytyng.com/en/blog/ubuntu-python-venv-error"
publish_date: "2018-08-14T06:45:11Z"
created: "2018-08-14T06:45:11Z"
updated: "2026-05-11T13:04:18.832Z"
categories: []
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/f5e8bd6bf8d64fbda2bfca127fafcdfb.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# When python3.6 -m venv Errors Occur on Ubuntu

```plaintext
$ python3.6 -m venv venv
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/ubuntu/venv/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']
```
When you encounter this kind of issue on Ubuntu 14 or 16

↓

```plaintext
$ python3.6 -m venv --without-pip venv

$ source venv/bin/activate
$ python --version

$ curl https://bootstrap.pypa.io/get-pip.py | python
```
Do it with `--without-pip`.
