This article will explain how to install virtualenv and create a new Python Project in eclipse which uses a custom virtual environment. There is also a little Hello World style example at the end!

This article assumes that you have Python, Eclipse and the PyDev plugin installed on your machine. If you need to know how to do this, please see my previous post: Setting up your Windows 10 System for Python Development (PyDev, Eclipse, Python).

In the current public version of Python, there is a bug in one of the packages which will display the following error message if you try to install any packages using pip:

Fatal error in launcher: Job information querying failed

This bug has been fixed in the current dev release but still exists in the production version at the time of writing this article. If you want to learn more about the status of this, you can track it via this ticket:

OK let’s get started.

Let me just re-iterate, this article assumes that you have Python installed with the necessary path variables set. If you have not done this or are in doubt, please follow this first: Setting up your Windows 10 System for Python Development (PyDev, Eclipse, Python).

Add Python scripts directory to system path

First, we add the python scripts directory to the system path. We do this so we can feel like we are using a unix based system where you can just type commands line pip into the console and they work (without having to type the full executable URL). Right click the Windows menu and select System.

Windows 10 system menu option screenshot

From the System menu, select Advanced system settings.

Windows 10 system menu screenshot

From the System Properties menu, select the Advanced tab and click on Environment Variables…

Windows 10 system properties screenshot

From the System variables section, location the Path variable, select it and click Edit…

System 10 system properties advanced screenshot

From the Edit System Variable menu, navigate to the end of the Variable value and append:


(note the semi colon which is used to separate the items in this list. Once done, click OK.

Windows 10 'path' system variable screenshot

Click OK on the Environment Variables screen.

Windows 10 system properties screenshot

On the System Properties screen, click OK.

windows 10 system properties advanced screenshot

Now exit the System menu by clicking X.

Windows 10 system menu screenshot

Install Virtualenv Using Pip and Create Your First Environment

Right click the Windows button and select Command Prompt (Admin). We load it in Admin mode because we are installing packages which will likely require elevated rights.

Windows 10 command prompt (admin) option screenshot

In the Administrator: Command Prompt type the following command to install virtualenv.

python -m pip install virtualenv

The reason we use the “-m” switch is because as mentioned at the beginning of this post, there is a bug in Python for Windows 10 which causes an error to occur when trying to install with pip.

After it’s installed, type exit to quit Command Prompt.

Windows 10 command prompt pip install screenshot

Next, load command prompt again but this time under your user account, by right clicking the Windows buttons and choosing Command Prompt.

Windows 10 Command Prompt Option Screenshot

Command prompt should start in “C:\Users\<username>\”. Create a new directory called virtualenvs by typing in the following command:

mkdir virtualenvs

Widnows 10 Command Prompt Virtualenv Screenshot

Then switch to that new directory by typing:

cd virtualenvs

Windows 10 Command Prompt Change Directory Screenshot

Now we will create a new virtual environment called london_app_dev. A “virtual environment” is a place where all the required Python packages and settings can be stored for a specific project. This allows you to have a unique set of installed packages for each project as opposed to having one shared set. This is useful if some projects require different versions of the same package for example. Create the virtual environment by typing the following command:

python -m virtualenv london_app_dev

Feel free to specify your own name by replacing london_app_dev with whatever you want. Just remember to what you named it, for the rest of the tutorial.

Windows 10 Create Virtual Env Screenshot

Create Your First Python Project in Eclipse

OK, now we have the virtual environment created, run Eclipse.

Windows 10 launch Eclipse Screenshot

Eclipse will load.

Windows 10 Eclipse Splash Screenshot

Once Eclipse loads, select File > New > PyDev Project from the menu.

Windows 10 Eclipse New PyDev Project Screenshot

Enter a Project name. I use the word Kaizen for this demonstration. Click the Please configure an interpreter before proceeding link to configure an interpreter (the thing that understands Python code)

Windows 10 Python PyDev New Project Screenshot

In the Configure interpreter menu, choose Manual Config.

Windows 10 PyDev New Project Python Interpreter Screenshot

In the Preferences screen, select New… next to the Python Interpreters section.

Windows 10 PyDev interpreters screenshot

In the Select interpreter screen, enter the Interpreter Name for your project (in this case, LondonAppDeveloper). In some cases you would give it a generic name such as Python, however because we are giving the project it’s own virtual environment we will give it a name specific to the project. After typing a name, click Browse.

Windows 10 PyDev create interpreter screenshot

In the Open screen, navigate to C:\Users\<user>\virtualenvs\london_app_dev\Scripts (where <user> is your username), and choose python from the list. Then click Open.

Windows 10 Eclipse PyDev select interpreter location screenshot

In the Select interpreter screen, select OK to save the settings and close it.

Windows 10 Eclipse PyDev Interpreter Screenshot

You will then be prompted which files you would like to add to the pythonpath. Leave all selected and choose OK.

Windows 10 Eclipse PyDev select paths to be added to Python Path Screenshot

Marvel at the Python Interpreter you have just added and select OK.

Windows 10 Eclipse Python Interpreters Screenshot

If a firewall request screen pops up for Eclipse, select Allow access.

Windows 10 Eclipse Firewall Request Screenshot

Eclipse will process your selection of Python interpreter.Wait patiently.

Windows 10 Eclipse Progress Information Screenshot

Now, back to the PyDev Project window, from the Interpreter drop down list, select LondonAppDeveloper.

Windows 10 Python Eclipse New Project Interpreter Selection Screenshot

Now you have chosen an Interpreter, click on Finish.

Eclipse Windows 10 New PyDev Project Screenshot

Now we will create our first Python file, on the project you just created (Kaizen), right click and select New > File.

Windows 10 PyDev new file screenshot

In the New File screen, type the name and click Finish.

Windows 10 Eclipse PyDev new file screenshot

On the Default Eclipse preferences for PyDev screen, leave the default selection and click OK.

Windows 10 eclipse PyDev default screenshot

Your new file should automatically open. Enter the following code:

import datetime

def hello_kaizen():

    print "Hello Kaizen: %s" % (


This will print the words Hello Kaizen and the current date and time when ran.

Windows 10 Python Hello World Screenshot

After you have written your script, select Run As… from the top menu.

Windows 10 Python PyDev Eclipse Hello World Screenshot

From the Run As menu, choose Python Run and click OK.

Windows 10 Eclipse PyDev run python screenshot

The console screen will appear at the bottom Eclipse, if you see something like the below response, you are done!

Windows 10 Python Eclipse Final Hello World Screenshot

Thank you for reading, I hope this walk-through added some value to your life 🙂