无法导入pyueye模块,dll错误

时间:2018-07-15 08:49:26

标签: python camera python-3.6 dllimport

我想使用pyueye模块来操纵我的IDS相机。我已经从制造商的网站上安装了最新的驱动程序,并且可以使用uEye Cockpit应用程序管理相机。我想写一些与相机一起使用的python脚本,但是我什至无法导入pyueye模块。

我的代码:

import ctypes
from pyueye import ueye
print(ueye.__version__)

错误信息:

C:\Python\python.exe C:/Users/Karol/PycharmProjects/ids_camera/ids_test.py
Traceback (most recent call last):
File "C:\Python\lib\site-packages\pyueye\dll.py", line 165, in load_dll
dll = DLL(libinfo, libnames, os.getenv(envname))
File "C:\Python\lib\site-packages\pyueye\dll.py", line 96, in __init__
raise RuntimeError("could not find any library for {} ({})".format(libinfo, 
dllmsg))
RuntimeError: could not find any library for ueye_api (DLL_PATH: unset)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 \File "C:/Users/Karol/PycharmProjects/ids_camera/ids_test.py", line 2, in 
<module>
     from pyueye import ueye
File "C:\Python\lib\site-packages\pyueye\__init__.py", line 55, in <module>
    from . import ueye
File "C:\Python\lib\site-packages\pyueye\ueye.py", line 54, in <module>
    get_dll_file, _bind = load_dll("ueye_api", ["ueye_api_64", "ueye_api"], 
"PYUEYE_DLL_PATH")
File "C:\Python\lib\site-packages\pyueye\dll.py", line 167, in load_dll
    raise ImportError(exc)
ImportError: could not find any library for ueye_api (DLL_PATH: unset)

Process finished with exit code 1

我已经通过pip安装了该模块,我的操作系统是Win 7 x64,我的python解释器是3.6,与ueye关联的* .dll文件也安装在C:\ Windows ...文件夹中。我也将ueye_api.dll和ueye_tools.dll文件复制到了pyueye目录,但这没有帮助。

2 个答案:

答案 0 :(得分:0)

我尝试将ueye_api_64.dll中的C:\Program Files\IDS\uEye\USB driver package添加到我的pyueye文件夹中。我还将此位置添加到系统变量的PATH中,这为我解决了问题。

答案 1 :(得分:0)

尝试以下操作:

  • 安装后重新启动计算机。
  • 确保DLL位于C:\ Windows \ System32目录中。
  • 将PYUEYE_DLL_PATH设置为DLL所在的目录。

如果没有任何帮助,请与IDS支持人员联系。