Today is my first day with Python and I am using pyenv to deal with Python's versions. I successfully installed the latest version (3.6.3) and set it as global with
pyenv global 3.6.3
Now when executing in terminal
/usr/bin/env python
I get the expected correct response
Python 3.6.3 (default, Oct 24 2017, 02:48:04)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
However the problem I have is that shebang I use in my script file has the same /usr/bin/env python
path but who knows why it still evaluates to the preinstalled system's version of Python which is 2.7.6.
I am checking the version used by script like this
#!/usr/bin/env python
import sys
print("Content-type:text/html\r\n\r\n")
print(sys.version)
and what I get printed by the browser (using Apache2) is
2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
I was restarting apache, playing with pyenv configs, googling for any hints but no success.
Anybody has any idea what is wrong here? Thanks a lot!