我是python的初学者。我已经在笔记本电脑上安装了python,其版本是win32上的python 2.7.18(v2.7.18:8d21aa21f2,2020年4月20日,13:19:08)[MSC v.1500 32位(英特尔)]。我正在尝试导入其他人创建的现有框架,并使用现有包创建一个新的示例python文件。我写了一句简单的话:
from machine_lib.pydblib import db
pydblib是从SWIG自动生成的文件。以下代码取自SWIG文件:
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_pydblib')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_pydblib')
_pydblib = swig_import_helper()
错误位于except块:return importlib.import_module('_pydblib')
,该块表示:
ImportError: DLL load failed: The specified module could not be found in pycharm.
我已经检查了同一个错误的答案,但没有任何效果。我怎样才能消除这个错误?如果需要,我很乐意分享更多信息。提前谢谢
相关说明如果您来这里搜索“python”、“导入错误”和“DLL加载失败”:在Python 3.8 DLL resolution under Windows has changed。另见what's new in Python 3.8:
您还可以使用ProcessMonitor检查Python正在查找的DLL的名称
相关问题 更多 >
编程相关推荐