rticau / ScreenCapLibrary

Robot Framework test library for capturing screenshots and video recording.
Apache License 2.0
39 stars 15 forks source link

Error import lib #59

Open kattinum opened 4 years ago

kattinum commented 4 years ago

Hello,

I found this issue while installing.

Getting requirements to build wheel ... error ERROR: Command errored out with exit status 1: command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py' get_requires_for_build_wheel 'c:\users\teammy\appdata\local\te mp\tmpqqqvvh' cwd: c:\users\teammy\appdata\local\temp\pip-install-1bimly\opencv-python Complete output (22 lines): Traceback (most recent call last): File "c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py", line 280, in main() File "c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py", line 263, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py", line 114, in get_requires_for_build_wheel return hook(config_settings) File "c:\users\teammy\appdata\local\temp\pip-build-env-llenxw\overlay\Lib\site-packages\setuptools\build_meta.py", line 146, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "c:\users\teammy\appdata\local\temp\pip-build-env-llenxw\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires self.run_setup() File "c:\users\teammy\appdata\local\temp\pip-build-env-llenxw\overlay\Lib\site-packages\setuptools\build_meta.py", line 243, in run_setup self).run_setup(setup_script=setup_script) File "c:\users\teammy\appdata\local\temp\pip-build-env-llenxw\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup exec(compile(code, file, 'exec'), locals()) File "setup.py", line 448, in main() File "setup.py", line 99, in main % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))} File "c:\python27\lib\re.py", line 210, in escape s = list(pattern) TypeError: 'NoneType' object is not iterable

ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py' get_requires_for_build_whee l 'c:\users\teammy\appdata\local\temp\tmpqqqvvh' Check the logs for full command output.


I ran the script and found the issue below that causes 'No keyword found'. I'm not sure it relates to the above issue or not. Any suggestion to resolve this case?

[ ERROR ] Error in file 'D:\automate\RF\RF-Scripts\POC\tests\PruCnt-Login-ValidID.robot' on line 4: Importing test library 'ScreenCapLibrary' failed: ImportError: No module named ScreenCapLibrary Traceback (most recent call last): None PYTHONPATH: C:\Python27\Scripts\robot.exe C:\WINDOWS\SYSTEM32\python27.zip c:\python27\DLLs c:\python27\lib c:\python27\lib\plat-win c:\python27\lib\lib-tk c:\python27 c:\python27\lib\site-packages

Thank you in advance

mihaiparvu commented 4 years ago

Could be because opencv-python no longer supports Python 2.7. You could try installing an older version: pip install opencv-python==4.2.0.32 and try again.

kattinum commented 4 years ago

Thank you for reply. I change python version to 3.5 and install open

Could be because opencv-python no longer supports Python 2.7. You could try installing an older version: pip install opencv-python==4.2.0.32 and try again.

Thank you for your suggestion. I change python version to 3.5 with recommended opencv-python. I still got this issue when I run a script

[ ERROR ] Error in file 'D:\automate\RF\RF-Scripts\POC\tests\PruCnt-Login-ValidID.robot' on line 4: Importing test library 'ScreenCapLibrary' failed: ImportError: Im porting cv2 failed. Make sure you have opencv-python installed. Traceback (most recent call last): File "c:\users\teammy\appdata\local\programs\python\python35\lib\site-packages\ScreenCapLibrary__init__.py", line 16, in from .library import ScreenCapLibrary File "c:\users\teammy\appdata\local\programs\python\python35\lib\site-packages\ScreenCapLibrary\library.py", line 17, in from .client import Client File "c:\users\teammy\appdata\local\programs\python\python35\lib\site-packages\ScreenCapLibrary\client.py", line 24, in raise ImportError('Importing cv2 failed. Make sure you have opencv-python installed.') PYTHONPATH: C:\Users\teammy\AppData\Local\Programs\Python\Python35\Scripts\robot.exe c:\users\teammy\appdata\local\programs\python\python35\python35.zip c:\users\teammy\appdata\local\programs\python\python35\DLLs c:\users\teammy\appdata\local\programs\python\python35\lib c:\users\teammy\appdata\local\programs\python\python35 C:\Users\teammy\AppData\Roaming\Python\Python35\site-packages c:\users\teammy\appdata\local\programs\python\python35\lib\site-packages

mihaiparvu commented 3 years ago

Do you still have this issue when trying to install latest version @kattinum?

simonmeggle commented 3 years ago

On Windows, also the installation of opencv-contrib-python is needed.

pikopl commented 8 months ago

I have the same problem: 09:53:55 [ ERROR ] Error in file '/opt/robotframework/robot_tests/tests/browser-library.robot' on line 3: Importing library 'ScreenCapLibrary' failed: ImportError: Importing cv2 failed. Make sure you have opencv-python installed. 09:53:55 Traceback (most recent call last): 09:53:55 File "/home/robot/.local/lib/python3.9/site-packages/ScreenCapLibrary/init.py", line 16, in 09:53:55 from .library import ScreenCapLibrary 09:53:55 File "/home/robot/.local/lib/python3.9/site-packages/ScreenCapLibrary/library.py", line 17, in 09:53:55 from .client import Client 09:53:55 File "/home/robot/.local/lib/python3.9/site-packages/ScreenCapLibrary/client.py", line 25, in 09:53:55 raise ImportError('Importing cv2 failed. Make sure you have opencv-python installed.') 09:53:55 PYTHONPATH: 09:53:55 /home/robot/.local/bin 09:53:55 /home/robot/.local/lib/python3.9/site-packages/cv2 09:53:55 /opt/piotr/python3/lib/python39.zip 09:53:55 /opt/piotr/python3/lib/python3.9 09:53:55 /opt/piotr/python3/lib/python3.9/lib-dynload 09:53:55 /home/robot/.local/lib/python3.9/site-packages 09:53:55 /opt/piotr/python3/lib/python3.9/site-packages

I have opencv-contrib-python installed: docker run --entrypoint pip epsec-docker/epsec/robotframework:0.0.270 freeze | grep opencv opencv-contrib-python==4.9.0.80 opencv-python==4.9.0.80

Please help @simonmeggle with this issue