9

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

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
amazone
  • 93
  • 1
  • 3
  • which linux distribution? – Anthony Kong Jan 30 '14 at 01: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. – alvits Jan 30 '14 at 01:40

2 Answers2

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

Anthony Kong
  • 37,791
  • 46
  • 172
  • 304
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.

tzot
  • 92,761
  • 29
  • 141
  • 204