Giter VIP home page Giter VIP logo

Comments (4)

activatedtmx avatar activatedtmx commented on August 11, 2024 2

For Pyinstaller use these additional commands:
--hidden-import pkg_resources --hidden-import infi.systray

from infi.systray.

wiggin15 avatar wiggin15 commented on August 11, 2024

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.

vudinhtuanhut avatar vudinhtuanhut commented on August 11, 2024

@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.

jaiwardhan avatar jaiwardhan commented on August 11, 2024

Solution by @activatedtmx seems to be the solution at least for Pyinstaller. Closing it as per comments.

from infi.systray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.