python has multiple versions for different users -


i running python script sudo, throws exception, found python versions different follows, i'm using centos 6:

[haifzhan@home]$ sudo python --version python 2.6.6 [haifzhan@home]$ sudo su - [root@home ~]# python --version python 2.7.5 [haifzhan@home]$ python --version python 2.7.5 

when login root or username, python version 2.7, when use sudo run, 2.6.

can tell me how make them version 2.7, should configure?

calling python means call first executable of name in directory pointed $path environment variable. different users have different $path variables set. propose have @ them understand executable called (it /usr/local/bin/python vs. /usr/bin/python or similar). view call, use type python once user , once user root.

to call specific python binary can call explicit full path (e. g. /usr/local/bin/python). call same executable regardless of value of $path variable.

alternatively can configure accounts both have same binary first in $path variable.

also, can try call python2.7 , python2.6; many installations symlink these corresponding binaries.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -