I am using a Macbook. It came with python 2.7.6 installed. I manually installed python 3.4. I develop websites using django. I have only used python 3 and when I work on a project, I simply put it inside a virtual environment.
For instance, I have a project using django-1.8 and python-3.4. I used the following command to create the environment:
python3 -m venv myvenv
After that I installed django and other packages inside of this environment.
However, I want to work on another project using python 2.7. How do I create an environment for python 2.7 and install packages inside of that, so that my other projects remain separate and workable at the same time?
Also, is this the best way to do things? Am I going to mess something up if I continue like this?
Edit: I tried a solution from another question. I ran the following command on the terminal:
virtualenv -p /usr/bin/python2.7 <path/to/new/virtualenv/>
I get the following error:
-bash:syntax error near unexpected token 'newline'
Also, I tried installing virtualenv using pip running this command:
pip install virtualenv
It says pip is not found which is weird as I have used pip countless times before inside my virtual environments. Am I making a stupid mistake?