Comment 4 for bug 1173010

Revision history for this message
Seth Hill (sethrh) wrote :

I started getting this after installing python3.4 in mint 15.

I installed python3.4 into /usr/local/bin, which comes before /usr/bin in my PATH.

My /etc/bash.bashrc runs command-not-found like so (using python 2.7):

    /usr/bin/python /usr/lib/command-not-found

The command-not-found script notices that it's running under python2, and then uses execvp("python3") to flip over to python 3.
However, in my case "python3" resolves to /usr/local/bin/python3.4 (because /usr/local/bin is first in my path)

Python3.4 doesn't have the CommandNotFound module, so it generates an ImportError.

I solved the problem by changing the execvp("python3") to execvp("/usr/bin/python3.3").

In summary, the script assumes that "python3" is the default system's python3.