brentvollebregt / auto-py-to-exe

Converts .py to .exe using a simple graphical interface
MIT License
3.95k stars 677 forks source link

pyinstaller converted .exe file not saving the images as required . #449

Closed Akashmsagar0707 closed 8 months ago

Akashmsagar0707 commented 9 months ago

I am stuck with an unusual problem. I have a GUI code written in Python PyQt5. It has images, put inside an image folder and many python files. This GUI is working fine in Pycharm. I am able to generate a standalone executable file for this project using Pyinstaller. When i run the exe , no images are visible in GUI . i have really tried hard and searched a lot of internet for the same , but still i am not getting this concept of getting the images . please help me for this .

img = QPixmap(":/results_drawing.jpeg")
img = img.scaledToWidth(380, Qt.FastTransformation)
resultsStaticImg = QLabel("")
resultsStaticImg.setPixmap(img)
resultsStaticImg.setStyleSheet("border-style: outset;text-align:center;border-width: 4px;border-radius: 10px; border-color: #00bfff;")
window.logoLayout.addWidget(resultsStaticImg, alignment=Qt.AlignCenter)
github-actions[bot] commented 9 months ago

👋 Hi, just a reminder that if you haven't read the help post yet, give it a read to see if your issue is covered in it and make sure to follow the debugging section.

Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help post, video or create a new discussion.

brentvollebregt commented 9 months ago

Some questions (all separate):

  1. Have you included this image file as an additional file?
  2. While using a one-directory build, can you see the file that you are referencing in QPixmap?
  3. Have you tried printing out the exact path that QPixmap will look for that file for at runtime and checked that the file exists?
github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment on this issue or it will be closed in 5 days.

github-actions[bot] commented 8 months ago

Closing issue due to no activity in more than 60 days.