I am trying to configure Python for my Emacs on Ubuntu, and I get the following error:
/usr/bin/env: python2: No such file or directory
Can someone help me with it? What can I do to resolve it?
I am trying to configure Python for my Emacs on Ubuntu, and I get the following error:
/usr/bin/env: python2: No such file or directory
Can someone help me with it? What can I do to resolve it?
Try this command in terminal
sudo ln -s /usr/bin/python2.6 /usr/bin/python2
or
sudo apt-get install python2
 
    
    Probably that's just true. The link /usr/bin/python2 -> (the real one) should be provided by your Python package, but that's obviously not the case, nor on any other location where it can be found via the $PATH.
You should put the said link in your path at the (an) appropriate place.
 
    
    On Ubuntu 12.04.
To find out what package owns the file:
$ apt-file -F find /usr/bin/python2
python-minimal: /usr/bin/python2
To find out what packages depend on the package:
$ apt-cache rdepends python-minimal
python-minimal
Reverse Depends:
  python2.7-minimal
 |livecd-rootfs
  python-minimal:i386
  python-support
  python2.7-minimal
  python
 |livecd-rootfs
It show that if you have python package then you should have python-minimal package then you should have /usr/bin/python2 file.
Check whether /usr/bin is in $PATH inside emacs. If it is and you can't run /usr/bin/python2 from a shell then you could reinstall python-minimal to restore /usr/bin/python2 file:
$ sudo apt-get --reinstall install python-minimal
