← Back to issue list

python projects might fail to snap if the package python-dev is not installed

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1501997
Type
issue
State
closed
Author
~elopio
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by adding libpython2.7-dev as a Python plugin build package in commit d436aa787, originally proposed in e8fc4bd0f.

Resolution: closed resolved

Reason: Launchpad identifies commit d436aa787 as the fix; it adds libpython2.7-dev to the Python plugin's build packages so Python 2 extensions can find Python.h.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Without libpython-dev, the py2-project example fails to snap with the following error: src/pykeccak.c:20:20: fatal error: Python.h: Dosiero aŭ dosierujo ne ekzistas To reproduce: # after bug #1501977 has been fixed. sudo apt-get remove libpython2.7-dev bzr branch lp:snapcraft cd snapcraft/examples/py2-project ./../../bin/snapcraft assemble I'm not sure how to fix this, because the py3-project works without the -dev libs. So I suppose they are not always required and it might be unnecessary to put it in the build-packages of plugins/python.yaml. But maybe it doesn't hurt to be extra careful and add it in there.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by adding libpython2.7-dev as a Python plugin build package in commit d436aa787, originally proposed in e8fc4bd0f.
stealth/space-bunny-alpha — closed resolved Fixed by adding libpython2.7-dev as a Python plugin build package in commit d436aa787 (originally proposed in e8fc4bd0f).
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. Likely abandoned due to age and lack of activity. No fix implemented or PR merged. The python-dev dependency issue remains unaddressed.
qwen/qwen3.6-35b-a3b — — Abandoned. Reported build failures when python-dev is missing, suggesting it be added to build-packages. No fix or merge was implemented.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft@d436aa787 (confidence 99%)

    Commit adds libpython2.7-dev to the Python plugin build packages.

  • Related To: snapcraft@e8fc4bd0f (confidence 95%)

    Original commit implementing the same build-package change.

Related issues

Issue Project State Summary Similarity
#1841861 Python plugins fails to build a snap when some parts depends on unpublished modules snapcraft (launchpad) closed Fixed by PR #2771 (commit 9bac0fd64), which made the Python plugin try processing setup.py before querying PyPI, allowing parts to use locally built packages.
71%
#1494825 examples/py2-project fails to build snapcraft (launchpad) closed Resolved in Snapcraft r164; commit e8fc4bd0f added libpython2.7-dev build packages to the Python 2 example, fixing the missing Python.h build failure.
70%