Comments (5)
👋 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.
from auto-py-to-exe.
I see you are referencing "enter.jpg"
in your script - since this is a relative reference, it will resolve relatively to the current working directory, which will most likely not be where the file is actually being stored in the bundle output.
To fix this, you need to wrap file references with resource_path
to correctly turn a relative path into an absolute path which will point to the correct file. For example,
icon.addPixmap(QtGui.QPixmap(resource_path("enter.jpg")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
You can read more about this in the help post under "The one-file Resource Wrapper".
from auto-py-to-exe.
Thank you very much for fast answer
should i write this code into my code?
i mentioned this in the class before setupUi def
def resource_path(relative_path):
import sys, os
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
and reference it in
icon.addPixmap(QtGui.QPixmap(resource_path("enter.jpg")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
i receive an error - undefined name "resource_path"
from auto-py-to-exe.
Yes, you need to add that function yourself. Nothing provides it for you and this tool doesn't add anything to your application.
from auto-py-to-exe.
you the besttttt!!!!!!!
thank you <3
from auto-py-to-exe.
Related Issues (20)
- Admin only GUI appearance HOT 10
- Pyinstaller Version Control HOT 2
- Pyinstaller 5.X.X is better? HOT 7
- auto-py-to-exe and configparser issue HOT 8
- Bug after trying to launch HOT 3
- Clicking the select file button will freeze on macOS 14.4 arm64 HOT 13
- Warning coloring problem HOT 3
- Unused models in the application HOT 3
- The numpy.array_api submodule is still experimental HOT 4
- just gave me a virus when compileing HOT 2
- Script requiring input HOT 17
- File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gevent\threadpool.py", line 173, in __run_task thread_result.set(func(*args, **kwargs)) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 3: invalid start byte HOT 4
- Relative Paths aren't resolved until in the temp directory HOT 5
- it loading all the requirements rather using venv requirements HOT 2
- how can we change the running command ? HOT 6
- Path option not working HOT 3
- Error: tkinter not found HOT 5
- Doesnt open with Run option on linux HOT 2
- ModuleNotFoundError HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-py-to-exe.