简体   繁体   中英

PyQt5 Python code not working cross platform

so i wrote a little GUI application in PyQt5 Designer(On my Linux machine) and i converted my GUI.ui to Python code and it runs just fine with the line

   $ python guiProto.py

the gui pops up and buttons work ect.

So Now i load up my windows computer and try to run the same python code using Cygwin64 terminal, and i get the following..

    $ python guiProto.py
    QXcbConnection: Could not connect to display

This was not an issue at all running on my Linux machine, i looked at the generated python code and it does not seem to specify operating systems or anything like that.. and i have looked up this "QXcbConnection: Could not connect to display" error and it is just not related to PyQt5 so i was confused

I made sure i had PyQt5 installed

 $ pip3 install PyQt5

 Requirement already satisfied: PyQt5 in c:\users\ryan\anaconda3\lib\site-packages (5.11.2)
 Requirement already satisfied: PyQt5_sip<4.20,>=4.19.11 in 
 c:\users\ryan\anaconda3\lib\site-packages (from PyQt5) (4.19.12)

I did design the GUI with Designer on my linux machine and i do not have that on my windows, i did not think that would make a difference since i have the PyQt5 package installed.

Any help would be appreciated for why this would work on my linux computer but not my windows..

Linux GUI programs are displayed by X server. Seems that your Cygwin installation is missing it. Install the packages xorg-server and xinit , and run startxwin .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM