Coder Social home page Coder Social logo

qt.qpa.plugin load error. about docker-pyqt5 HOT 6 CLOSED

jozo avatar jozo commented on August 19, 2024
qt.qpa.plugin load error.

from docker-pyqt5.

Comments (6)

jozo avatar jozo commented on August 19, 2024

Hi. It seems your $IP variable is empty. Did you run this before?

IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')

What is the output of

echo $IP

?

from docker-pyqt5.

michelejoyce avatar michelejoyce commented on August 19, 2024

Same error.

IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
$ echo $IP

192.168.1.16

docker run --rm -it
-v /tmp/.X11-unix:/tmp/.X11-unix
-e DISPLAY=$DISPLAY
-u qtuser
jozo/pyqt5 python3 /tmp/hello.py

qt.qpa.xcb: could not connect to display /private/tmp/com.apple.launchd.V4GO9HuUSU/org.macosforge.xquartz: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.

from docker-pyqt5.

michelejoyce avatar michelejoyce commented on August 19, 2024

I killed and restarted an xterm. I get the Hello World (whoop!)

A slightly different error:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-qtuser'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

I suppose the next question is:
Do I simply add your docker image to my docker-compose.py?

from docker-pyqt5.

jozo avatar jozo commented on August 19, 2024

Now you have set $IP variable but notice that you don't use it when you call docker. Try again:

docker run --rm -it \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$IP:0 \
    -u qtuser \
    jozo/pyqt5 python3 /tmp/hello.py

from docker-pyqt5.

michelejoyce avatar michelejoyce commented on August 19, 2024

I did, I had just cut and paste an old command.
I can now get the test app up....thanks..

Do I simply add your local build to my docker-compose.py script?
Do I have to preface the execution of the application with
jozo/pyqt5 python3 mypyapp.py

from docker-pyqt5.

jozo avatar jozo commented on August 19, 2024

I suppose the next question is:
Do I simply add your docker image to my docker-compose.py?

I don't know what is in your docker-compose.py or how you use it. It's up to you. :) If you need help with your project I recommend to write a question to StackOverflow.

from docker-pyqt5.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.