在 Ubuntu 12.10 64 位上使用 Python 2.7 给我带来了以下麻烦:
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.c_bool()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'c_bool'
>>>
如何解决这个问题?
最佳答案
您工作的目录中有一个名为“ctypes.py”的文件吗?如果是这样,请移动它或(最好)重命名它。
关于Ubuntu 上的 Python : 'module' object has no attribute 'c_bool' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15393291/