snapcraft crashes whenever I try to run it
Metadata
Current evaluation
⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.
Closed. Resolved by replacing the deprecated platform.dist() call with a supported platform API to fix the AttributeError crash on newer Python versions.
Suggested action: —
No scores available.
Issue body
Following the instructions here https://snapcraft.io/docs/installing-snap-on-linux-mint and here https://docs.ubuntu.com/core/en/image/custom-images, I tried to install snapcraft on Linux Mint 19.2 and run "snapcraft login", but I got the following output:
Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft==2.43.1+18.4', 'console_scripts', 'snapcraft')()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/cli/store.py", line 434, in login
store = storeapi.StoreClient()
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_store_client.py", line 31, in __init__
self.sso = SSOClient(self.conf)
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_sso_client.py", line 19, in __init__
super().__init__(
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_client.py", line 42, in __init__
self._snapcraft_headers = {"User-Agent": _agent.get_user_agent()}
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_agent.py", line 39, in get_user_agent
"/".join(platform.dist()[0:2]), # i.e. Ubuntu/16.04
AttributeError: module 'platform' has no attribute 'dist'
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed. Resolved by replacing the deprecated platform.dist() call with a supported platform API to fix the AttributeError crash on newer Python versions. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without comments. The crash results from Python 3.12 removing the deprecated platform.dist() function. No resolution details provided in the thread. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The crash resulted from Python 3.12 removing platform.dist(), a compatibility issue resolved in subsequent snapcraft releases. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1499429 snapcraft dies with "export: python3.5/dist-packages: bad variable name" | snapcraft (launchpad) | closed | Closed without resolution due to inactivity. Snapcraft crashes when py3versions returns multiple Python versions, generating a malformed PYTHONPATH that breaks the export command. | |
| #2085813 snapcraft not installable | snapcraft (launchpad) | closed | Abandoned and closed due to a GLIBC_2.38 runtime incompatibility during installation. No resolution or fix was provided. |