You are not logged in.
When I run /usr/bin/python2 from the command line, everything works as expected:
shunya% /usr/bin/python2
Python 2.7.2 (default, Jun 29 2011, 11:10:00)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'2.7.2 (default, Jun 29 2011, 11:10:00) \n[GCC 4.6.1]'
>>>
When I attempt to execute a script with python2, it uses python3 instead. For instance:
1 #!/usr/bin/python2
2
3 import sys
4 print (sys.version)
5
6 sys.exit()
gives the following output:
3.2.1 (default, Jul 11 2011, 12:37:47)
[GCC 4.6.1]
Press ENTER or type command to continue
Any ideas?
Offline
Unable to reproduce.
barrucadu on azathoth in ~/tmp
>>> cat test.py
#!/usr/bin/python2
import sys
print(sys.version)
sys.exit()
barrucadu on azathoth in ~/tmp
>>> ./test.py
2.7.2 (default, Jun 29 2011, 11:10:00)
[GCC 4.6.1]
How are you executing the file?
Offline
Thank you Barrucadu. The problem was:
map <buffer> <S-e> :w<cr>:!/usr/bin/env python % <cr>
in my python.vim,
Last edited by knuckles (2011-08-15 18:33:42)
Offline