10

When ever i mistype or do a error into the console the following message come up:

Traceback (most recent call last):
  File "/usr/lib/python3.3/site.py", line 629, in <module>
    main()

  File "/usr/lib/python3.3/site.py", line 614, 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 610, in get_config_var
    return get_config_vars().get(name)

  File "/usr/lib/python3.3/sysconfig.py", line 560, in get_config_vars
    _init_posix(_CONFIG_VARS)

  File "/usr/lib/python3.3/sysconfig.py", line 432, 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'

I have both Python 2.7 and 3.3 install with Anaconda. I wonder if this is normal or it was a conflict between python 2.7 and 3.3

2
  • which linux distribution? Commented Jan 30, 2014 at 1:34
  • Having both 2.7 and 3.3 is normal. The directories are well defined and separated. However, you have to execute the specific version that you need. Thus there is /usr/bin/python2.7 and /usr/bin/python3.3. The default /usr/bin/python will be a softlink to either of them. You can verify which python is being used by a utility. Yum is one of the utilities that use python. You can verify which python version it is supposed to use by running rpm -V yum. After verification, make sure the utility is executing the correct python. Commented Jan 30, 2014 at 1:40

2 Answers 2

8

Assuming you are using ubuntu, here is the relevant bug report https://bugs.launchpad.net/ubuntu/+source/python3.3/+bug/1192890

You need to patch your /etc/bash.bashrc. See comment #6 for details

Sign up to request clarification or add additional context in comments.

2 Comments

So if i get it right, you need to open the command-not-found programm and change line of code?
Yes. Change python /usr/lib/command-not-found -- $1 to /usr/lib/command-not-found -- $1
2

Actually, it's possible you have another python3 in your PATH before /usr/bin (most probably in /usr/local/bin) in your system, one which lacks the ubuntu-provided libraries (used by /usr/bin/python3). That happens with hashbangs using #!env python3 and the PATH environment variable.

If this is the case, then temporarily make unavailable (eg renaming them) all such non-/usr/bin/python3* executables, do your system administration stuff and then make them again available.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.