jozo / docker-pyqt5 Goto Github PK
View Code? Open in Web Editor NEWDockerfile for development of GUI applications with Python 3 + PyQt5
Dockerfile for development of GUI applications with Python 3 + PyQt5
Hello,
I am trying to use this on a Raspberry Pi 4 running Raspbian, and when I try to run the test script using:
docker run --rm -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
-u qtuser \
jozo/pyqt5 python3 /tmp/hello.py
I get the following error:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
standard_init_linux.go:219: exec user process caused: exec format error
Do you know how I might fix this issue? Thanks
Hi,
I try to run Qt5 application with Docker, when I run with qtuser it works well.
However, when I try to run with the root user, I got the error
'''
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
loaded library "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
No protocol specified
qt.qpa.screen: QXcbConnection: Could not connect to display :0
Could not connect to any X display.
QLibraryPrivate::unload succeeded on "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
'''
I already add the root user to the audio group.
How can I run Qt5 application with the root user?
My environment is ubuntu 18.04 in Jetson Nano Dev Kit
Thank you!
When I clone, build, then run I get the following error: QXcbConnection: Could not connect to display
I've searched around and there are various fixes that people suggest and none work. Did you ever have this issue and is there any suggestions?
Update: Does not work on Mac. However, works fine on a PC Virtual box Image of Ubuntu for the versions listed.
Hi. I'm hoping you can help me. I'm at wit's end.
I am trying to create a PyQt5 application with python3, from my mac.
I have previously solved the XQuartz/x window problem, while writing an app with tkinter.
I'm having difficulty getting all of the parts and pieces to work with PyQt5 -- a more modern look and feel.
I have attempted to run your test app, but I get the same error
$ docker run --rm -it
-v /tmp/.X11-unix:/tmp/.X11-unix
-e DISPLAY=$IP:0
-u qtuser
jozo/pyqt5 python3 /tmp/hello.py
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Thanks.
Michele
Hi,
I am trying to test out this Dockerfile but can't seem to get it to work. I ran the command as you said in your README, but got this error:
acfoster@Adriannas-MacBook-Pro docker-pyqt5 % docker run -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd)/test:/app \
-e DISPLAY=$DISPLAY \
-u qtuser \
fadawar/docker-pyqt5 python3 /app/hello.py
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-qtuser'
qt.qpa.screen: QXcbConnection: Could not connect to display /private/tmp/com.apple.launchd.nJM1c2qxF5/org.macosforge.xquartz:0
Could not connect to any X display.
I am trying to build this on a Mac running macOS 10.15.5 (Catalina)
Thank you!
Greetings,
I am trying to run the linux example:
docker run --rm -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
-u qtuser \
jozo/pyqt5 python3 /tmp/hello.py
and receive the following error message:
No protocol specified
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Not sure what the exact problem is but my hostname is set, $DISPLAY is set to :0 by default, whether that is correct or not is something I don't know. The primary and currently only Display of my notebook is (following xrandr):
Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 16384 x 16384
eDP-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory
这是为什么?
Hi,
When I use it on macOS as the below method, I got the error: qt.qpa.xcb: could not connect to display $IP:0
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
xhost +
docker run --rm -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$IP:0 \
-u qtuser \
jozo/pyqt5 python3 /tmp/hello.py
I am sure that my container can print chinese with python , but can not display chinese char in pyqt commponent .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.