This line near the bottom:
python /usr/lib/command-not-found -- $1
should be:
/usr/lib/command-not-found -- $1
Long explanation follows:
I had the same issue. For me issue occurred whenever I mistyped a command.
/usr/lib/command-not-found is a python program.
I found that if I ran it like:
python3.3 /usr/lib/command-not-found bad-command
it ran fine, but
python /usr/lib/command-not-found bad-command
Resulted in:
Traceback (most recent call last):
File "/usr/lib/python3.3/site.py", line 631, in <module>
main()
File "/usr/lib/python3.3/site.py", line 616, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python3.3/site.py", line 250, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python3.3/sysconfig.py", line 580, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python3.3/sysconfig.py", line 530, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python3.3/sysconfig.py", line 403, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python3.3/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'
The issue lied in /etc/bash.bashrc
This line near the bottom:
python /usr/lib/command-not-found -- $1
was invoking python 2.
Changing it to:
python3.3 /usr/lib/command-not-found -- $1
TL;DR
The issue for me lied in /etc/bash.bashrc
This line near the bottom: command- not-found -- $1
python /usr/lib/
should be: command- not-found -- $1
/usr/lib/
Long explanation follows:
I had the same issue. For me issue occurred whenever I mistyped a command.
/usr/lib/ command- not-found is a python program.
I found that if I ran it like: command- not-found bad-command command- not-found bad-command
python3.3 /usr/lib/
it ran fine, but
python /usr/lib/
Resulted in: python3. 3/site. py", line 631, in <module> python3. 3/site. py", line 616, in main ages(known_ paths) python3. 3/site. py", line 284, in addusersitepackages ages() python3. 3/site. py", line 260, in getusersitepackages python3. 3/site. py", line 250, in getuserbase var('userbase' ) python3. 3/sysconfig. py", line 580, in get_config_var vars(). get(name) python3. 3/sysconfig. py", line 530, in get_config_vars posix(_ CONFIG_ VARS) python3. 3/sysconfig. py", line 403, in _init_posix python3. 3/_sysconfigdat a.py", line 6, in <module>
Traceback (most recent call last):
File "/usr/lib/
main()
File "/usr/lib/
known_paths = addusersitepack
File "/usr/lib/
user_site = getusersitepack
File "/usr/lib/
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/
USER_BASE = get_config_
File "/usr/lib/
return get_config_
File "/usr/lib/
_init_
File "/usr/lib/
from _sysconfigdata import build_time_vars
File "/usr/lib/
from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'
The issue lied in /etc/bash.bashrc
This line near the bottom: command- not-found -- $1
python /usr/lib/
was invoking python 2.
Changing it to: command- not-found -- $1
python3.3 /usr/lib/
or just plain: command- not-found -- $1
/usr/lib/
fixed the problem for me :)