Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import cv2 failed #81

Open
Mavnus04 opened this issue Mar 28, 2022 · 1 comment
Open

Import cv2 failed #81

Mavnus04 opened this issue Mar 28, 2022 · 1 comment

Comments

@Mavnus04
Copy link

General information:

  • OS name: Window
  • OS version: 10
  • OS architecture: 64 bits
  • Python version: 3.7.9
  • mss version: 6.1.0
  • Robot Framework version: 4.1.3
  • robotframework-screencaplibrary version: 1.6.0
  • opencv-python: 4.5.5.64

Description of the warning/error

run a robot test with Library ScreenCapLibrary

Full message

[ ERROR ] Error in file 'C:\jenkins\workspace\Resources\Utilities\GenericActions.resource' on line 7: Importing library 'ScreenCapLibrary' failed: ImportError: Importing cv2 failed. Make sure you have opencv-python installed.
Traceback (most recent call last):
  File "c:\program files\python37\lib\site-packages\ScreenCapLibrary\__init__.py", line 16, in <module>
    from .library import ScreenCapLibrary
  File "c:\program files\python37\lib\site-packages\ScreenCapLibrary\library.py", line 17, in <module>
    from .client import Client
  File "c:\program files\python37\lib\site-packages\ScreenCapLibrary\client.py", line 25, in <module>
    raise ImportError('Importing cv2 failed. Make sure you have opencv-python installed.')
PYTHONPATH:
  C:\Program Files\Python37\Scripts\robot.exe
  c:\program files\python37\python37.zip
  c:\program files\python37\DLLs
  c:\program files\python37\lib
  c:\program files\python37
  c:\program files\python37\lib\site-packages
  c:\program files\python37\lib\site-packages\win32
  c:\program files\python37\lib\site-packages\win32\lib
  c:\program files\python37\lib\site-packages\Pythonwin

Example

Screenshot.Robot:

*** Settings ***
Library   ScreenCapLibrary

*** Test Cases ***
Get a screenshot
    ScreenCapLibrary.Take Screenshot

Other details

robotframework-screencaplibrary

>pip show robotframework-screencaplibrary
Name: robotframework-screencaplibrary
Version: 1.6.0
Summary: Robot Framework test library for taking screenshots
Home-page: https://github.com/mihaiparvu/ScreenCapLibrary
Author: Mihai Pârvu
Author-email: [email protected]
License: Apache License 2.0
Location: c:\program files\python37\lib\site-packages
Requires: imageio, mss, opencv-python, pillow, pyautogui, robotframework
Required-by:

opencv-python

>pip show opencv-python
Name: opencv-python
Version: 4.5.5.64
Summary: Wrapper package for OpenCV python bindings.
Home-page: https://github.com/skvark/opencv-python
Author:
Author-email:
License: MIT
Location: c:\program files\python37\lib\site-packages
Requires: numpy
Required-by: robotframework-screencaplibrary
@Mavnus04
Copy link
Author

Mavnus04 commented Apr 1, 2022

Looks like it might be an error with opencv itself.

C:\python
>>>import cv2
...
ImportError: DLL load failed: The specified module could not be found.

Its one of the FAQ at https://pypi.org/project/opencv-python/
Working on getting there solution to fix my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant