Comments (6)
I have fixed it using a hidden import:
pyinstaller -F main.py --hidden-import wakepy._deprecated._windows -n keepawake
Thanks to everyone who helped.
from wakepy.
As a quick comment, I would guess this is because there are dynamical imports in wakepy, and I guess the pyinstaller might not understand to include all the modules to the build.
There probably is some option in pyinstaller which allows you to see which modules (.py files) it did include. Could you check which files were included?
from wakepy.
Here's the result of a 'verbose' debug build. Hope it helps.
wakepyVerboseDump.txt
from wakepy.
Thanks for the dump! Basically what it says is the same as in the original question:
ModuleNotFoundError: No module named 'wakepy._deprecated._windows'
What this means is that when you're bundling your python app into an executable with pyinstaller, pyinstaller has not included the file wakepy._deprecated._windows.py. The reason is that wakepy 0.7.1 detects your operating system and imports the correct module at run-time in wakepy/_deprecated/__init__.py using the importlib.import_module
.
The pyinstaller documentation talks here about what kinds of modules pyinstaller can automatically detect. It mentions specifically that modules imported dynamically for example with importlib.import_module
are not automatically detected by pyinstaller.
I have no experience on pyinstaller so unfortunately I probably cannot help you further with that; I'm guessing this is more about your pyinstaller configuration than about wakepy. I would go first through the pyinstaller docs and make sure it includes all the modules for the used packages. In case of wakepy 0.7.1, you would need to include all the modules from wakepy/_deprecated
(or, if you're building only for Windows, the wakepy._deprecated._windows.py
).
from wakepy.
from wakepy.
Nice to hear you found a solution!
from wakepy.
Related Issues (20)
- inv test failing on Windows
- Code coverage not shown on windows (inv test)
- Importing wakeypy nukes logging config HOT 3
- GitHub Releases are not shown (except to repo owner) HOT 3
- There's still one place calling the log methods of the logging module directly (logging.info())
- Publish also to conda-forge?
- Rename the CLI flags: Have same naming convention everywhere. --keep-presenting and -r
- Android support
- Add support for BSD systems HOT 3
- Keep a remote server awake after closing SSH connection? HOT 2
- Improve Supported Platforms table
- Wakepy on browser (Pyodide, PyPy.js, Brython, Transcrypt, Skulpt)
- Add support for cygwin
- Add support for ChromeOS
- Add to docs: "Prior to Windows 11 power requests were held an additional 2 minutes after they were dropped by the application. "
- Update migration guide: Add on_fail action example
- Docs: Tell that (most of?) the wakepy Methods will keep the idle/sleep timer at zero for the duration of the context manager
- Conditionally using wakepy modes
- on_success / on_activation hook? (similar to on_fail)
- Include `on_fail="warn"` in the examples of the README / docs?
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 wakepy.