Closed joellidin closed 8 months ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
sudo apt-get update && sudo apt-get install -y python3-pip python3-tk python3-dev
sudo pip3 install pyautogui
touch $HOME/.Xauthority
echo "import pyautogui" > test.py
echo "pyautogui.press('enter')" >> test.py
python3 test.py
@thelamer Thanks for the reply. Unfortunately, I still get
Xlib.error.DisplayConnectionError: Can't connect to display ":1.0": [Errno 2] No such file or directory
Yeah you would need to run this from the web session or as the user abc with the with-contenv wrapper to get the env variables.
I did run this inside the container from the web session. I don't really now what the with-contenv
wrapper is and cand find any information about it. Could you provide a reference so I can read about it?
This is not a support forum, I can move the mouse and send key events with pyautogui:
sudo apt-get update && sudo apt-get install -y python3-pip python3-tk python3-dev
sudo pip3 install pyautogui
touch $HOME/.Xauthority
echo "import pyautogui" > test.py
echo "pyautogui.press('enter')" >> test.py
echo "print(pyautogui.position())" >> test.py
echo "pyautogui.moveTo(100, 200)" >> test.py
echo "print(pyautogui.position())" >> test.py
python3 test.py
Xlib.xauth: warning, no xauthority details available
Xlib.xauth: warning, no xauthority details available
Point(x=1093, y=582)
Point(x=100, y=200)
cat /command/with-contenv
#!/command/execlineb -S0
ifelse
{
importas -D 0 S6_KEEP_ENV S6_KEEP_ENV
eltest 0${S6_KEEP_ENV} -eq 0
}
{
emptyenv -p
s6-envdir -Lfn -- /run/s6/container_environment
exec
$@
}
$@
Is there an existing issue for this?
Current Behavior
When running
lscr.io/linuxserver/webtop:ubuntu-xfce
and trying to runpyautogui
inside the container I get the following error:I have tried searching around the web and trying out different suggestions but nothing worked for me. I can use
pyautogui
in docker-headless-vnc-container, but then I run into other issues I do not have with webtop. Since it works in another vnc container I would suspect it to work if I configure it correctly?Expected Behavior
No response
Steps To Reproduce
With this Dockerfile:
And this docker-compose.yaml:
Then inside container run
pip install pyautogui
and then using the replpython
:Environment
CPU architecture
x86-64
Docker creation
Container logs