-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Issue when using importlib_metadata inside a standalone application #71
Comments
In GitLab by @mcdanieldave on Jun 25, 2019, 17:55 Hi, I ran into this issue with cx_freeze. The code that sets Option 1: Put a file called "EGG-INFO" in one of the directories that importlib-metadata is searching for meta data in. In the case of cx_freeze this is in the Option 2: You could also drop the proper Option 3:
For now I opted for the last option since it only impacts the version of |
In GitLab by @jaraco on Jul 13, 2019, 05:10 This issue was encountered in jaraco/irc#159. |
In GitLab by @jaraco on Jul 13, 2019, 05:23 The underlying issue is that pyinstaller and cx_Freeze are discarding important package metadata when constructing their artifacts (executables, etc). Similar to what you propose in option 2, here's what I recommend: Either,
Considering option 3, it's possible that importlib_metadata could be more lenient about discovering its own metadata, but I fear, as you mention, that will only postpone the inevitable and lead to failures later when metadata is needed by the consumer of importlib_metadata. Therefore, I recommend that these meta packagers address the concerns. Please feel free to reference this issue/comment when filing issues with those projects. I'll be happy to advise those projects to support what's needed. |
In GitLab by @jaraco on Sep 1, 2019, 16:05
I should have also recommended against using egg-info metadata, as dist-info metadata is more modern and likely to be supported longer. Additionally, you can use tools like pep517 to generate that metadata from source distributions, or you can extract that metadata directly from wheels. |
In GitLab by @jaraco on Sep 2, 2019, 14:39 I don't believe there's anything more for importlib_metadata to do here, but feel free to continue the conversation here or open a new issue as appropriate. |
In GitLab by @jaraco on Sep 2, 2019, 14:39 closed |
In GitLab by @lowlyocean on May 16, 2020, 21:09 Hi Jason, just wanted to flag this is also encountered by Nuitka when trying to use keyring module in standalone application: |
In GitLab by @jaraco on Jun 5, 2020, 17:22 Hi Daniel. Sorry you've encountered the issue. I don't see any reason why the recommendation for Nuitka is any different than for the other bundlers. The recommendation is for these bundlers to supply the metadata. |
In GitLab by @jaraco on Jun 5, 2020, 17:31 mentioned in merge request !120 |
In GitLab by @pe2mbs on Jun 12, 2020, 10:00 Hi,
Specially on this line in the 'importlib_metadata' module.
As it seems PyInstaller doesn't include the Package information in full. I've patched import_metadata as described in the patch above, now it works just fine. I like to appeal to include the patch into the package. |
In GitLab by @jaraco on Jun 14, 2020, 15:58 reopened |
In GitLab by @jaraco on Jun 14, 2020, 16:14 This issue has come up also in importlib_resources 94 and 100 and #124. Rather than wrap this clunky code with a try/except block, I'm inclined to instead recommend that projects just not supply a What this means is that the scope of the problem will be limited in environments like PyInstaller and cxFreeze and stash, avoiding errors when something tries to import |
In GitLab by @jaraco on Jun 14, 2020, 16:33 mentioned in commit 3aab89a1fcf30d31a7c6721d7d641f2bd70c5c5c |
In GitLab by @jaraco on Jun 14, 2020, 16:55
Essentially no. Another way of phrasing the question would be "is there a way for libraries like keyring to load package metadata when a bundler omits that metadata?" The only way for something like that to work would be for all packages to have zero reliance on package metadata, which obviates the whole purpose of this project - to allow projects to have a meaningful relationship with their metadata and the metadata of other projects. Keyring (and any other project using entry points) relies heavily on the ability to detect entry points advertised by other projects. I do think it's reasonable for bundlers to provide workarounds (patches) to accommodate these packages as a transition until the bundler can provide native support for supplying metadata, but I'd like to avoid these bundlers imposing that a workaround be implemented across the ecosystem and thus mask the underlying deficiency. |
In GitLab by @jaraco on Jun 26, 2020, 22:42 closed via merge request !125 |
In GitLab by @astrofrog on Jun 14, 2019, 11:43
I'm using PyInstaller to build standalone Python applications, but I've run into issues with importlib_metadata. Specfically, if I make a Python script called e.g.
test_app.py
with:then run PyInstaller with:
The resulting application crashes when trying to get the version for PyInstaller:
Other users of PyInstaller seem to have run into this too (see e.g. this issue).
I've only ever run into this issue with
importlib_metadata
, and haven't had a chance to investigate what this could be due to.The text was updated successfully, but these errors were encountered: