-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem packaging markdown in App using fbs/PyInstaller #1067
Comments
Not recently (Calibre did for many years although I don't believe they do anymore). And the related code is new as of version 3.3. If you are sure you (or any of your dependencies) are not using In any event, based on the traceback, the error appears to occur because importlib.util.module_from_spec is returning
Presumably we need to check for |
Was it really me? Anyway, it seems that the problem is indeed caused by our tricks with So either we declare that Python-Markdown is not compatible with PyInstaller (or some workaround specific for PyInstaller is found), or we actually bundle a copy of html.parser instead of monkey-patching it. We also can copy the |
I did a little more digging. I was able to artificially generate the same error: >>> spec = importlib.util.find_spec('unknown')
>>> print(spec)
None
>>> unknown = importlib.util.module_from_spec(spec)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 553, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader' Of course, there is no module named What I missed yesterday is that My guess is that PyInstaller is using something different than the standard finders because they don't work in that environment. After all, the standard finders work on file paths and PyInstaller builds a single file executable. However, as we are calling the lower level API, presumably PyInstaller's overrides are ignored. As this is an officially supported Python library, I would consider this to be a bug in PyInstaller. Maybe they document some special way to call @jralden I see the following option: You can take this upstream to fbs/PyInstaller. Maybe they provide a fix on their end, or maybe they suggest a patch to our code which we would be willing to accept. However, this isn't a high priority for us so we're not going to spend any more time trying to work out a fix ourselves. |
I have a question. I'm using markdown in a PyQt5 application, and am trying to package it for distribution using fbs/PyInstaller. The program crashes when the packaged result is executed with an error in line 30 of the htmlparser:
The error reported is:
Clearly it's not a bug, since it works correctly in the unpackaged code. I was wondering whether you're aware of any successful attempts to package markdown. Also, fbs is only approved for Python 3.6, although it is reported to work for 3.7. Is there anything about the code above that depends on > 3.6? I should also mention that the app works correctly when packaged if I remove the use of markdown.
The text was updated successfully, but these errors were encountered: