Pip and virtualenv on Windows

Written by Art, June 18, 2017

Install pip

Pip (Python Package Installer), official documentation for pip.

Usually Python3 comes with pip preinstalled. If you get an error "pip command not found", use the following command to install pip:

Download get-pip.py, make sure you're saving file to Desktop

In your Command Prompt navigate to Desktop

cd Desktop

Execute get-pip.py

python get-pip.py

Now pip should work system wide.

virtualenv

In your Command Prompt enter:

pip install virtualenv

Launch virtualenv

In your Command Prompt navigate to your project:

cd your_project

Within your project:

virtualenv env

Activate your virtualenv:

on Windows, virtualenv creates a batch file

\env\Scripts\activate.bat

to activate virtualenv on Windows, activate script is in the Scripts folder :

\path\to\env\Scripts\activate

Example:

C:\Users\'Username'\venv\Scripts\activate.bat

Another way to install pip

Save the "ez_setup.py" file to your desktop form https://bootstrap.pypa.io/ez_setup.py

In your Command Prompt navigate to Desktop:

cd Desktop

Execute ez_setup.py:

python ez_setup.py

install pip:

easy_install pip


Share with:

About author


Art

Art is a FinTech enthusiast who has a great passion for coding and teaching. He earned a M.Sc. from Adelphi University, Garden City, New York. Currently, he develops software for the financial services industry and leads classes and workshops in Python at PracticalProgramming.co

Python 101

This class aims to help beginners to feel justifiably confident to start using Python programming language

Learn more

Python for Data Science

Learn how to apply Python analytics libraries Pandas, NumPy and Matplotlib for Data Science

Learn more

Python Immersive

Become a proficient Python programmer, master programming skills by working on real life projects

Learn more

Web Scraping

We go through the whole process of gathering, storing and analyzing data from the Web

Learn more

Build Web App

This is practical course for those who want to create a Web Application from scratch using Django

Learn more