There are two version of python.
The 2.7 and the 3.5 (or more if you are reding this in the future).
You could start your projects with different versions and different modules (of different versions).
How can we work without having to think to the different versions of this stuffs..?
With virtualenv.
First of all install it with pip.
Go in the command line and write (see the picture):
pip install virtualenv
Now, we will see how to use different versions of python with no problems.
Now create a folder "venv" and right click on it, click on open command line window from here and the prompt of the command line will appear.
Let's say we use python 3.4 as the default version
write this
Thes the pc will make something
My version of python is in the python34_32bit folder, your will be in a different folder, and a different version.
The program will install some basic stuff and it's done.
Now write this 3 commands:
cd env34
cd scripts
activate
As you see an (env34) will appear on the left, you are in a special environment. If you will install a module now, this will affect only this environment and not your default version of python or another environment.
You can have as many environments as you want.
In the next post we will see how to create an environment for a 2.7 version of python.
Comments
Post a Comment