gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.99k stars 1.25k forks source link

Can I use PyQt5 with GitPod? #815

Closed hidehiro98 closed 3 years ago

hidehiro98 commented 5 years ago

I try to use PyQt5 in this Repo. https://github.com/hidehiro98/alife_book_src

But got this warning.

WARNING: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-gitpod'

This looks not an error, but nothing happened.

Is there a way to solve this?

jankeromnes commented 5 years ago

Hi @hidehiro98, thank you for filing this issue. I believe that the warning is indeed not an error.

The reason that you don't see anything happening is that a graphical window is opened in the Virtual Desktop on port 6080.

When I opened https://github.com/hidehiro98/alife_book_src and tried these commands:

pip3 install pyglet pymunk vispy keras tensorflow pyqt5
cd chap02
python3 game_of_life.py

and also configured port 6080 to automatically open a preview:

ports:
  - port: 6080
    onOpen: open-preview

(But you can also Expose and Preview ports manually instead, directly from the bottom bar.)

I then was able to see the graphical PyQt5 window:

Screenshot 2019-09-30 at 12 40 30

(It didn't show anything that looked like a game of life, but probably that's a different issue.)

I'll send a Pull Request to your fork, with the changes that made it work for me.

hidehiro98 commented 5 years ago

Thank you so much @jankeromnes ! I tried it and got the same window. I'll try to display what I want to see. I think almost there...

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jankeromnes commented 3 years ago

I believe this can be closed now. 🎉

Please reply here if this is still an issue.