Can't pip install charmcraft on latest Ubuntu
Metadata
Current evaluation
Closed through documentation: PR #691 (commit 8204c111) added PyPI installation instructions after the reporter confirmed pip installation itself succeeded.
Resolution: closed not a bug
Reason: The maintainer cited merged PR #691, commit 8204c111, which documented installing Charmcraft from PyPI. No direct python-apt packaging change was identified when the report was closed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
As mentioned in https://github.com/canonical/charmcraft/pull/487#issuecomment-894529408 , trying to pull any version of charmcraft newer than 1.0.0 with pip on Ubuntu series newer than Focal will fail with
```
Collecting python-apt
Using cached python-apt-0.7.8.tar.bz2 (49 kB)
ERROR: Command errored out with exit status 1:
command: /home/lourot/Documents/git/canonical/charm-nova-compute-nvidia-vgpu/.tox/build/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bpzx9t64/python-apt_dae4b8816222415991bfc123d7d1dab9/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bpzx9t64/python-apt_dae4b8816222415991bfc123d7d1dab9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-qulkv83y
cwd: /tmp/pip-install-bpzx9t64/python-apt_dae4b8816222415991bfc123d7d1dab9/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-bpzx9t64/python-apt_dae4b8816222415991bfc123d7d1dab9/setup.py", line 6, in <module>
from DistUtilsExtra.command import *
ModuleNotFoundError: No module named 'DistUtilsExtra'
```
The solution would be to install a much newer version of `python-apt` on your system with `sudo apt install python-apt`, however this is not possible anymore on Ubuntu series newer than Focal: there only `python3-apt` can be apt-installed, and it doesn't get picked up because charmcraft has a dependency to `python-apt`, not `python3-apt`.
The only workaround I found so far is to also `pip install` the latest `python-apt` by adding this to my `build-requirements.txt`:
```
git+https://salsa.debian.org/apt-team/python-apt.git#egg=python-apt
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed not a bug | Closed through documentation: PR #691 (commit 8204c111) added PyPI installation instructions after the reporter confirmed pip installation itself succeeded. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed via documentation: PR #691 (commit 8204c111) added PyPI installation instructions, and the maintainer cited the updated README before closing. | |
| stealth/space-bunny-alpha | — | closed not a bug | Addressed in PR #691 (commit 8204c111), which documented PyPI installation; the maintainer cited it when closing the issue on 2022-03-03. | |
| stealth/space-bunny-alpha | — | closed not a bug | Addressed through documentation: PR #691 (43241f1e, commit 8204c111) added PyPI installation instructions, which the maintainer cited on 2022-03-03. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. PyPI installation instructions were added to the README to resolve pip install failures on newer Ubuntu versions caused by python-apt dependency conflicts. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after maintainers added PyPI installation instructions to the README. The python-apt dependency conflict on newer Ubuntu versions was addressed via documentation updates instead of a code fix. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without code changes. Resolution involved updating the README with official PyPI installation instructions to resolve the python-apt dependency conflict on newer Ubuntu versions. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#691
(confidence 96%)
Merged documentation PR cited in the closing maintainer comment; it added the PyPI installation instructions.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #816 pip install charmcraft installs v1.0 | charmcraft | closed | Closed as expected behaviour: on Ubuntu 18.04 with Python 3.6, pip backtracked to Charmcraft 1.0.0 because newer deps (e.g. humanize) require Python >=3.7. Maintainer also fixed a release glitch so 2.0.0 was on PyPI; reporter confirmed Focal works. | |
| #858 Cannot install cryptography Python package as sdist using `charmcraft -v pack` | charmcraft | closed | Reporter closed it themselves as not a charmcraft bug: maintainer facundobatista showed a workaround (override-build writing /etc/xdg/pip/pip.conf for the private index, plus charm-binary-python-packages), confirmed working. | |
| #691 Instructions to install it from PyPI. | charmcraft | merged | Merged PR #691 added 14 lines of README instructions for installing Charmcraft from PyPI, addressing #615; merge commit 43241f1e. | |
| #922 Unable to pack charms on a GCP instance | charmcraft | closed | Closed as not a Charmcraft bug: Focal's old setuptools broke pip's wheel installation. Preinstalling setuptools via charm-python-packages works around it; #923 tracked the same regression. |