Screencast Virtualenv and Python Environments Python

  • Sarah Holderness
Badge student

Locked Content

A subscription is required for viewing this video. Enroll now to get full access to all Code School courses and content.

Enroll Now Sign in


  1. justbecause said

    I have both python (python 2) and python 3 installed on my Mac. When I install venv, only python2.7 gets installed. How would I install python3.5? Thanks for this video!

  2. Faculty

    Sarah Holderness said

    You can use the command "virtualenv -p python3 venv" to use Python 3 instead. "-p" lets you specify the version of Python. I hope that helps!

  3. Denis said

    Is that one time only? I mean if I deactivate virtualenv next time I have to install all the things again?

  4. Samuel Garcia said

    No, if you deactivate the next time you wanna use just activate and everything is just like the last time.

  5. Erika said


  6. Julio Vita said

    Thank you for the insight.

  7. Prateek Parekh said

    I'm getting the following error:

    Traceback (most recent call last): File "/Users/pp/django-project/env3/bin/django-admin", line 11, in sys.exit(execute_from_command_line()) File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/core/management/", line 385, in execute_from_command_line utility.execute() File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/core/management/", line 354, in execute django.setup() File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/", line 18, in setup from django.utils.log import configure_logging File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/utils/", line 10, in from django.views.debug import ExceptionReporter, get_exception_reporter_filter File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/views/", line 10, in from django.http import (HttpResponse, HttpResponseServerError, File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/http/", line 4, in from django.http.response import (HttpResponse, StreamingHttpResponse, File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/http/", line 13, in from django.core.serializers.json import DjangoJSONEncoder File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/core/serializers/", line 23, in from django.core.serializers.base import SerializerDoesNotExist File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/core/serializers/", line 6, in from django.db import models File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/db/models/", line 6, in from django.db.models.query import Q, QuerySet, Prefetch # NOQA File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/db/models/", line 13, in from django.db.models.fields import AutoField, Empty File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/db/models/fields/", line 18, in from django import forms File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/forms/", line 6, in from django.forms.fields import * # NOQA File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/forms/", line 18, in from django.forms.utils import from_current_timezone, to_current_timezone File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/forms/", line 15, in from django.utils.html import format_html, format_html_join, escape File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/utils/", line 16, in from .html_parser import HTMLParser, HTMLParseError File "/Users/pp/django-project/env3/lib/python3.6/site-packages/django/utils/", line 12, in HTMLParseError = _html_parser.HTMLParseError AttributeError: module 'html.parser' has no attribute 'HTMLParseError'

    Python version info below: python --version Python 3.6.5

About This Screencast

In this episode, Sarah Holderness will be talking about virtualenv, which is a Python package that allows you to install isolated Python directories on your computer. You'll learn how to install, create, activate, and deactivate virtualenv.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now