Running Ubuntu 14.04 and updater says that all software is up to date. Have tried rebooting.
I am preparing for a class that uses Python. I have installed it and it works fine. However, I now have this problem: When I type an unknown command into bash, I get a python error:
cliff@Climate:~$ UnknownProgram
Fatal Python error: Py_Initialize: Unable to get the locale encoding
File "/usr/lib/python2.7/encodings/__init__.py", line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Aborted
cliff@Climate:~$ env | grep -i python
PYTHONPATH=/usr/lib/pymodules/python2.7:/usr/lib/python2.7
cliff@Climate:~$ which UnknownProgram
cliff@Climate:~$ which python
/usr/bin/python
cliff@Climate:~$ python --version
Python 2.7.6
cliff@Climate:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
I think that pycharm also installed some python3 on the box.
I have found that /usr/lib/command-not-found includes a shebang for python3. I guess that it is somehow picking up the wrong Py_Initialize file. How do I correct this since I need python 2.7 for the class?
UnknownProgram
?which
does not tell you if it exists. – wxl Sep 02 '14 at 19:20UnknownProgram
the actual name for something? If not, can you provide us with the program you're actually calling? – Mitch Sep 02 '14 at 19:36$PATH
– Dan Sep 02 '14 at 20:19