snapcraft python2 plugin build fails because of .pth and PYTHONPATH test
Metadata
Current evaluation
Fixed Python plugin setup.py handling in snapcore/snapcraft#718, merged as commit 810136457.
Resolution: closed resolved
Reason: The linked pull request was merged and appears in Snapcraft history as commit 810136457, providing plugin changes that allow affected setup.py projects to build.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Pulling nyx
Cloning into '/home/cmiller/work/canonical/tor-snap/parts/nyx/src'...
remote: Counting objects: 95, done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 95 (delta 1), reused 36 (delta 0)
Unpacking objects: 100% (95/95), done.
Checking connectivity... done.
Note: checking out 'e249dc8f5c4c282326324161cf8421f947cf660e'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
python2 /home/cmiller/work/canonical/tor-snap/parts/nyx/install/usr/bin/easy_install --prefix /home/cmiller/work/canonical/tor-snap/parts/nyx/install/usr pip
TEST FAILED: /home/cmiller/work/canonical/tor-snap/parts/nyx/install/usr/lib/python2.7/site-packages does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/home/cmiller/work/canonical/tor-snap/parts/nyx/install/usr/lib/python2.7/site-packages
and your PYTHONPATH environment variable currently contains:
'/home/cmiller/work/canonical/tor-snap/stage/usr/lib/python2.7/dist-packages'
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
Command '['/bin/sh', '/tmp/tmp26__6vxo', 'python2', '/home/cmiller/work/canonical/torsnap/parts/nyx/install/usr/bin/easy_install', '--prefix', '/home/cmiller/work/canonical/tor-snap/parts/nyx/install/usr', 'pip']' returned non-zero exit status 1
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed Python plugin setup.py handling in snapcore/snapcraft#718, merged as commit 810136457. | |
| stealth/space-bunny-alpha | — | closed resolved | Python plugin handling was fixed by #718 (commit 810136457); later #822 explicitly stopped filtering .pth files. | |
| stealth/space-bunny-alpha | — | closed stale | Python 2 easy_install rejected the build because the target site-packages directory was outside PYTHONPATH; the report closed without a documented fix. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The python2 plugin .pth and PYTHONPATH validation failure was abandoned, superseded by Python 3 migration and official Python 2 deprecation. | |
| qwen/qwen3.6-35b-a3b | — | — | Build failed due to easy_install .pth and PYTHONPATH validation error. The issue was closed without comments or resolution, indicating it was abandoned or superseded by updated snapcraft plugins. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#718
(confidence 99%)
The issue author linked this PR, and it was merged as commit 810136457.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1626668 python imports are messed up because of missing pth file | snapcraft (launchpad) | closed | Regression from #765 was fixed by PR #822 (commit 66d6f7827), which stopped the Python plugin filtering .pth files; the fix shipped in Snapcraft 2.18.1. | |
| #1778716 snapcraft clean snapcraft fails as it cannot find python | snapcraft (launchpad) | closed | Fixed by snapcore/snapcraft PR #2171, which corrected Python plugin cleanup so `snapcraft clean snapcraft` no longer fails when python3 is unavailable. | |
| #1626839 [Tech Debt] Regression test for missing .pth file with python plugin | snapcraft (launchpad) | closed | Closed with no recorded regression-test fix. The underlying missing-.pth bug was fixed by canonical/snapcraft#822 (66d6f7827), released in Snapcraft 2.18.1. | |
| #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. | |
| #1860884 Python plugin: paths for from the snapcraft snap in sys.path break dependencies | snapcraft (launchpad) | closed | Snapcraft's Python plugin no longer leaks its site-packages into part builds. Fixed by snapcore/snapcraft#2901 (c13c79d76a) and released in Snapcraft 3.10. | |
| #1675479 python plugin doesn't work for namespace packages | snapcraft (launchpad) | open | 2017 report that snapcraft's in-tree python plugin mishandled namespace packages (missing __init__.py / .pth) for Python 2.7 classic snaps; maintainer called it invalid, reporter's workaround was touch-ing __init__.py, no activity since 2017. |