尝试运行 python 脚本时,出现错误AttributeError: 'module' object has no attribute 'pydebug'。我正在使用 Python 2.6。
完整错误:
File "/lib/python2.6/distutils/sysconfig.py", line 238, in get_makefile_filename
return os.path.join(lib_dir, "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
Run Code Online (Sandbox Code Playgroud)
我认为无论你尝试运行什么,都希望与 python 的特殊调试版本一起使用。sys.pydebug通常在 sys 模块的标准版本中找不到,我相信如果你构建了一个调试 python,它就会在那里:
http://docs.python.org/c-api/intro.html#debugging-builds
这也可能是 Debian/Ubuntu 发行版正在使用的特定构建的一部分。