Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux - Weird Python Output

Tags:

python

linux

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

like image 232
amazone Avatar asked Jan 30 '14 01:01

amazone


2 Answers

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

like image 97
Anthony Kong Avatar answered Nov 02 '22 05:11

Anthony Kong


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.

like image 2
tzot Avatar answered Nov 02 '22 07:11

tzot