Comments (4)
For Pyinstaller use these additional commands:
--hidden-import pkg_resources --hidden-import infi.systray
from infi.systray.
I'm afraid I'm not familiar enough with these tools to debug the issue. Perhaps you should try to report this issue on their side. I don't know of anything that the package is doing wrong so I don't have anything to fix.
from infi.systray.
@activatedtmx You're very great!
In the past, I put the following code in my scrip (.py)
from infi.systray import SysTrayIcon
I already installed infi.systray from pip and checked the installed version with this command pip show infi.systray (Result: Version: 0.1.11); location: C:\Users\Admin\appdata\local\programs\python\python37-32\Lib\site-packages\ with 2 folders: "infi" and "infi.systray-0.1.11-py3.7.egg-info").
+My OS Windows 7 (32 bit)
+Python 3.7.1
*Firstly, I run my program successfully on console:
python my_program.py
However, I built the .exe file by pyinstaller and ran the .exe file:
+Sometimes, I double clicked on .exe and saw error "Failed to execute script" and the program stopped
+Sometimes, I double clicked on .exe and with no error but nothing happened. (the program stopped)
*I checked carefully and realized that the error just happened at the line in my script:
from infi.systray import SysTrayIcon
And it just happened if file .exe (it's okay with running my_program.py from consonle with python)
*I followed your instruction and it's good to build file .exe and the file .exe works well.
Here is my full command to build my program:
pyinstaller --hidden-import pkg_resources --hidden-import infi.systray --add-data="Becksport.jpg;." --add-data="becksport__eZD_icon.ico;." --icon="becksport__eZD_icon.ico" -d all my_program.py
After running that command, I saw values automatically generated in my_program.spec as:
hiddenimports=['pkg_resources', 'infi.systray']
To be noted that we need to copy 2 folders "infi" and "infi.systray-0.1.11-py3.7.egg-info" into the same folder containing file my_program.py and my_program.spec. It let pyinstall locate the installed packages.
If I don't copy installed packages to the same folder containing file my_program.py and my_program.spec, maybe we need to modify the command line of pyinstaller to let it know where the installed packages are.
One more time, thank you so much for your instruction.
from infi.systray.
Solution by @activatedtmx seems to be the solution at least for Pyinstaller
. Closing it as per comments.
from infi.systray.
Related Issues (20)
- ModuleNotFoundError: No module named 'infi.systray' HOT 3
- _load_icon picks wrong resolution HOT 1
- Passing arguments for the function in menu_options. HOT 1
- SysTrayIcon.shutdown produces threading join exception HOT 6
- Icon not loading at windows start HOT 2
- Creating customized menu
- left-click to show the menu HOT 2
- How to add a specific order to tray icons?
- How to update menu options values with systray.update() ?
- How to add text after tray icon.
- Conflict with win10toast HOT 1
- Fonts are blurred when scaling on highDPI monitors HOT 2
- How to add title of menu? HOT 1
- Provide a way to skip adding the default Quit option HOT 2
- Background color changed (feature pls)
- Pop-up bubble/balloon notification (feature request) HOT 1
- systray.shutdown with tkinter doesn't work together HOT 1
- Is there way to remove the Quit command from the systray icon ? HOT 2
- Systrayicon not visible when running the script from windows task schedular. HOT 5
- How to use default Quit option to quit my application instead of quitting only infi.systray? 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 infi.systray.