Closed jcsingh closed 2 years ago
hi, thanks for the bug report. We do have linux in our acceptance tests. They used to be run on Ubuntu 20.04 but currently it's using 22.04 already. In any case we have not seen this. Can you tell a bit more about your environment / configuration? The "no display detected" message is interesting and probably meaningful.
X server needs to be running and it seems like it's not. If you look at our headless acceptance tests, you will find we do something like this for example:
DISPLAY: :88
...
sudo apt-get install matchbox scrot
Xvfb $DISPLAY -screen 0 1920x1080x24 & sleep 1
matchbox-window-manager -use_titlebar no &
Thanks @tkoukkari. Steps in your last comment fixed the issue for me.
Thanks @tkoukkari. Steps in your last comment fixed the issue for me.
Great!
Tuomas
Describe the bug Python (3.8.12) import of QWeb (2.0.4) fails on Ubuntu (20.04.5 LTS)
To Reproduce Steps to reproduce the behavior:
[ WARN ] Cannot import pynput.keyboard, no display detected
| [ ERROR ] Error in file '/workdir/resources/UICommon.resource' on line 2: Importing library 'QWeb' failed: ImportError: this platform is not supported: ('failed to acquire X connection: Bad display name ""', DisplayNameError('')) | | Try one of the following resolutions: | | * Please make sure that you have an X server running, and that the DISPLAY environment variable is set correctly | Traceback (most recent call last): | File "/usr/local/lib/python3.8/site-packages/QWeb/init.py", line 26, in
| from QWeb.keywords import (alert, browser, window, frame, element, text, checkbox, input ,
| File "/usr/local/lib/python3.8/site-packages/QWeb/keywords/text.py", line 27, in
| from pynput.keyboard import Controller
| File "/usr/local/lib/python3.8/site-packages/pynput/init.py", line 40, in
| from . import keyboard
| File "/usr/local/lib/python3.8/site-packages/pynput/keyboard/init.py", line 31, in
| backend = backend(name)
| File "/usr/local/lib/python3.8/site-packages/pynput/_util/init.py", line 76, in backend
| raise ImportError('this platform is not supported: {}'.format(
| PYTHONPATH:
| /workdir
| /usr/local/lib/python38.zip
| /usr/local/lib/python3.8
| /usr/local/lib/python3.8/lib-dynload
| /usr/local/lib/python3.8/site-packages
Expected behavior Python should be able to import QWeb module
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context The exception is caused by Pynput module on Ubuntu