1

任何想法为什么我在尝试导入时会收到此错误ctypes

>>> from ctypes import *

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    from ctypes import *
  File "C:/Python27\ctypes.py", line 3, in <module>
    libc = ctypes.windll.msvcrt
AttributeError: 'module' object has no attribute 'windll'
4

1 回答 1

5

"C:/Python27\ctypes.py"ctypes.py表示您在加载的路径中有一些杂散,而不是标准库ctypes模块(本质上应该是Lib/ctypes/__init__.py

该文件尝试ctypes(再次)加载,最终加载自身(或多或少)。

删除/重命名该文件。

于 2013-09-15T19:06:14.847 回答