Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sudo does not find new python version

Tags:

python

linux

I had python2.6 on my linux box but installed python3.4 to use new modules. I installed it using sudo access. The new version was installed in /usr/local/bin. Without root access, I can use the new python3.4, both by just using python3.4 in the command line or using the shebang in the .py file #!/usr/local/bin/python3

Now I am trying to install a module, for which I need sudo access. When I am root, and I run python3.4, it says command not found. I ran whereis python and found the path to python2.6 in /usr/bin, but whereis python3.4 as root gives, not found in /usr/bin, which is correct since it is in /usr/local/bin. Again, if I exit from root, I have no trouble using python3.4

This seems like a $PATH issue (not sure), can some one help me what I am doing wrong while installing the module for the new python3.4? I was able to install the module, but it was installed in the old python2.6 site-packages.

like image 462
Reise45 Avatar asked Jan 10 '23 09:01

Reise45


1 Answers

How about export PATH+=:/usr/local/bin, try it, maybe helpful.

like image 126
大宝剑 Avatar answered Jan 11 '23 23:01

大宝剑