本文介绍了Linux-奇怪的Python输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在控制台中输入错误或输入错误时,会出现以下消息:

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'

我同时使用Anaconda安装了Python 2.7和3.3.我不知道这是正常现象还是python 2.7和3.3之间的冲突

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

推荐答案

假设您使用的是ubuntu,这是相关的错误报告 https://bugs.launchpad.net/ubuntu/+source/python3.3/+bug/1192890

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

您需要修补/etc/bash.bashrc.有关详情,请参见评论6.

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

这篇关于Linux-奇怪的Python输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 10:19