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

Error import lib #59

Open
kattinum opened this issue Aug 27, 2020 · 5 comments
Open

Error import lib #59

kattinum opened this issue Aug 27, 2020 · 5 comments

Comments

@kattinum
Copy link

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
Copy link
Collaborator

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
Copy link
Author

kattinum commented Aug 27, 2020

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
Copy link
Collaborator

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

@simonmeggle
Copy link

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

@pikopl
Copy link

pikopl commented Feb 28, 2024

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

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

4 participants