Comments (9)
To be honest, I have always used pypiwin32
and I had no issues embedding that module with py2exe
. I'll investigate this issue but, in the meantime, could you try to use pypiwin32
instead and see what happens?
from py2exe.
first time I hear about these issues with pywin32.
But you were right, simply installing pypiwin32 solves the problem.
from py2exe.
TIL that pypiwin32
actually acts as a shim that just installs pywin32
itself, so when you install pypiwin32
you should actually have both. So, I do not understand what could have caused this issue.
Anyway, the issue hints to a mismatch between the file extension reported by the loaded module itself (.dll
) and the expected extension for a python module library (.pyd
).
At the moment, however, I am unable to reproduce this bug. I tried to pack the test script with both packages installed (pywin32
and pypiwin32
) and after deleting the second, no bug. I also tried to include in the py2exe_test4.py
script a module from the package (I chose win32pipe
) but the packaging still works in both cases. The required pywintypes37.dll
is always correctly embedded in the dist folder.
I guess that I could give it another look if you manage to reproduce the bug, otherwise I am going to close this. Thanks anyway for reporting it.
from py2exe.
yes I also saw a requirement for pypiwin32 is pywin32
I tried and couldnt' reproduce the error anymore.
I guess it's because of pypiwin32 even though I use virtual environment
you can close it I guess
from py2exe.
I just found out that I still get the exception when I launch the py2exe from my PyCharm using debug mode.
When I run it using Run mode there's no exception.
I have no idea why.
Installing pypiwin32 doesn't help.
It still fails with assert if I launch it in debug.
Reading the docs it seems that the assertion should work the same unless I specify the -O flag to python to ignore assertions but somehow it is ON by default.
In any case the py2exe succeds in building the executable and it runs fine so I don't see how the assertions makes a difference.
Perhaps there is another nuance that I'm missing with my test that would fail later. Not sure. Or perhaps the assertion is too rigid.
Not sure if this should be considered an issue though.
from py2exe.
If I had to guess, I would say that the debug mode of PyCharm interferes with the libraries loaded by the packages and sought by mf3
. It makes sense though that pypiwin32
did not solve the issue, because it literally contains no code.
In any case the py2exe succeds in building the executable and it runs fine so I don't see how the assertions makes a difference.
Is there any advantage in running a frozen executable built with py2exe
when PyCharm was in debug mode? Otherwise, I would say to just avoid using this mode for freezing software. I am not a user of PyCharm, so I cannot be of much help here.
from py2exe.
I just tested it and you're right. It has to do with the PyCharm debugger. The assertions are not disabled.
I wasn't trying to run a frozen executable in debug mode, rather the py2exe compilation process. That's useful to debug py2exe issues.
from py2exe.
I wasn't trying to run a frozen executable in debug mode, rather the py2exe compilation process. That's useful to debug py2exe issues.
What are the extra data provided when running py2exe
with PyCharm in debug mode?
from py2exe.
I was using the debug mode to debug the OPCODE issue for example.
Just generally debugging a process is better than running it through.
Breakpoints, introspection, etc...
from py2exe.
Related Issues (20)
- Link on the py2exe wiki page does not go anywhere HOT 2
- Missing LICENSE in wheels HOT 4
- AssertionError with Python embeddable package HOT 1
- Py_OptimizeFlag not set correctly during Python initialization
- OSError: [WinError 87] The parameter is incorrect. HOT 2
- PYTHONPATH module location HOT 1
- Exe is created by doesn't run (opens then closes)
- Simple pygame example tries to lookup files inside of `library.zip` HOT 1
- Support Python 3.12 HOT 23
- Impossible to specify different version info for each of the binaries with the new freeze API. HOT 3
- pynput import break the file HOT 1
- PYTHONIOENCODING is ignored
- pendulum package doesn't initialize when unpacking from zipfile
- add version for python 3.12 too
- usage missing
- Does py2exe support 'QtWebEngineWidgets' of PySide6?
- How do I get an app using jaydebapi to work as an executable ?
- Failure to import zipextimporter with error "No module named '_memimporter'"
- [freeze][zipfile] Dependent packages and modules are not zipped to library.zip or packed to .exe bin
- ImportError: MemoryLoadLibrary failed loading PyQt5\QtWidgets.pyd: The specified module could not be found. (126)
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 py2exe.