I have two versions of python installed (used for diffrent projects)
as follows:
I have a script in the followin folder:
/home/user/Desktop/P
I want to set this folder/script to use Python 2.7.11 by default. i used this line in the script:
#!/bin/env python2.7
as suggested here: https://stackoverflow.com/a/11320015
But it doesn't work. It still goes to Python 2.7.6
How can I set the folder to use Python 2.7.11
for every script there?
Is it possible to just run it with "Python" keyword and it will know which version of python to select?
Edit: This is what I did: Followed this guide: http://docs.python-guide.org/en/latest/dev/virtualenvs/
sudo pip install virtualenv
cd my_project_folder
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
Now it looks like:
however why when I do Python --version
i get:
I expected it to refer the "Python" to the current version since I call it from this folder.
Why it doesn't work?