我有這個問題。 有什麼想法?AttributeError:'模塊'對象沒有屬性'可打印'
from OpenGL.raw.GLUT import *
File "/usr/lib/python2.6/site-packages/OpenGL/raw/GLUT/__init__.py", line 6, in <module>
from OpenGL.raw.GLUT.constants import *
File "/usr/lib/python2.6/site-packages/OpenGL/raw/GLUT/constants.py", line 7, in <module>
from OpenGL import platform, arrays
File "/usr/lib/python2.6/site-packages/OpenGL/platform/__init__.py", line 36, in <module>
_load()
File "/usr/lib/python2.6/site-packages/OpenGL/platform/__init__.py", line 27, in _load
plugin_class = plugin.load()
File "/usr/lib/python2.6/site-packages/OpenGL/plugins.py", line 14, in load
return importByName(self.import_path)
File "/usr/lib/python2.6/site-packages/OpenGL/plugins.py", line 28, in importByName
module = __import__(".".join(moduleName), {}, {}, moduleName)
File "/usr/lib/python2.6/site-packages/OpenGL/platform/glx.py", line 3, in <module>
from OpenGL.platform import baseplatform, ctypesloader
File "/usr/lib/python2.6/site-packages/OpenGL/platform/baseplatform.py", line 4, in <module>
from OpenGL.platform import ctypesloader
File "/usr/lib/python2.6/site-packages/OpenGL/platform/ctypesloader.py", line 6, in <module>
import ctypes, logging, os
File "/usr/lib/python2.6/logging/__init__.py", line 31, in <module>
import sys, os, types, time, string, cStringIO, traceback
File "string.py", line 3, in <module>
chars=set(string.printable),
AttributeError: 'module' object has no attribute 'printable'
謝謝!我參考了「AttributeError:'模塊'對象沒有任何屬性」。我忘了那個劇本。也許在未來的Python會知道什麼是庫。 –
@ThomasWouters我有同樣的問題。但我所擁有的是'String.py',它是大寫字母。我認爲這不同於「string.py」,並沒有導致錯誤。但它確實如此。我正在使用'Python 2.7.9'。你可以點亮一下嗎? – smwikipedia
我找到了根本原因並在下面發佈。 – smwikipedia