【发布时间】:2018-04-02 22:17:57
【问题描述】:
我的脚本需要在包含其他 python 文件和库(.py、.pyd 等)的目录中运行,但与文件冲突,我猜测它来自与脚本相同目录中的文件 _ctypes.pyd:
C:\Users\Guest\AppData\Local\Programs\Python\Python35-32\python.exe "C:/Program Files (x86)/Program/script.py"
Traceback (most recent call last):
File "C:/Program Files (x86)/Program/script.py", line 3, in <module>
import ctypes
File "C:\Users\Guest\AppData\Local\Programs\Python\Python35-32\lib\ctypes\__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: dynamic module does not define module export function (PyInit__ctypes)
有没有办法解决这个问题?脚本需要能够在任何目录中运行而不会出错
【问题讨论】:
标签: python python-3.x python-3.5 pyd