【问题标题】:Getting error while importing a file: OSError: [WinError 126] The specified module could not be found导入文件时出错:OSError: [WinError 126] The specified module could not be found
【发布时间】:2020-08-05 09:59:58
【问题描述】:

我在尝试将 thisImagingSource 文件导入我的应用程序时收到以下错误消息。我目前的操作系统是Windows10。以前在使用 Windows8 时,我没有收到同样的错误。有人可以帮我吗?

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-2-b6bb7e0c0dc0> in <module>
      8 """
      9 import ctypes as C
---> 10 import tisgrabber as IC
     11 import cv2
     12 import numpy as np

~\Documents\Python Scripts_20200422\application\tisgrabber.py in <module>
     25 GrabberHandle._fields_ = [('unused', C.c_int)]
     26 
---> 27 class TIS_GrabberDLL(object):
     28     if sys.maxsize > 2**32 :
     29         __tisgrabber = C.windll.LoadLibrary("tisgrabber_x64.dll")

~\Documents\Python Scripts_20200422\application\tisgrabber.py in TIS_GrabberDLL()
     27 class TIS_GrabberDLL(object):
     28     if sys.maxsize > 2**32 :
---> 29         __tisgrabber = C.windll.LoadLibrary("tisgrabber_x64.dll")
     30     else:
     31         __tisgrabber = C.windll.LoadLibrary("tisgrabber.dll")

C:\ProgramData\Anaconda3\lib\ctypes\__init__.py in LoadLibrary(self, name)
    440 
    441     def LoadLibrary(self, name):
--> 442         return self._dlltype(name)
    443 
    444 cdll = LibraryLoader(CDLL)

C:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle,     use_errno, use_last_error)
    362 
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: [WinError 126] The specified module could not be found

【问题讨论】:

    标签: python importerror oserror


    【解决方案1】:

    我认为 tisgrabber 不包含在标准 python 库中,因此您必须安装它。您可以使用控制台命令pip install &lt;name of the module&gt; 执行此操作。

    【讨论】:

    • 其实我已经下载了模块。这是一个 .py 文件,现在我正在尝试通过“import tisgrabber”导入它。不需要 pip 安装它,因为它已经在驱动器上可用。问题出现在ctypes后面,这里抛出错误 OSError : [WinError 126]
    • 我认为他们有同样的问题
    猜你喜欢
    • 2020-12-18
    • 2020-10-15
    • 2021-04-04
    • 2020-11-24
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    • 1970-01-01
    • 2017-05-11
    相关资源
    最近更新 更多