kjf*_*tch 4 python ctypes python-2.6 importerror
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\ctypes\__init__.py", line 17, in <module>
from struct import calcsize as _calcsize
ImportError: cannot import name calcsize
>>> from ctypes import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\ctypes\__init__.py", line 17, in <module>
from struct import calcsize as _calcsize
ImportError: cannot import name calcsize
>>>
Run Code Online (Sandbox Code Playgroud)
看来你的路径中有另一个struct.py.
试试看python找到你的struct模块的地方:
>>> import inspect
>>> import struct
>>> inspect.getabsfile(struct)
'c:\\python26\\lib\\struct.py'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3493 次 |
| 最近记录: |