Python easy_install fails when second of two python parts builds

Bug #1613898 reported by David Ames on 2016-08-16
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snapcraft
High
Sergio Schvezov
Ubuntu
Undecided
Unassigned

Bug Description

When two python parts are used and one uses after: the dependent part fails to
build when easy_install gets confused about PYTHON pathing.

snapcraft.yaml

name: mojo
version: 0.1
summary: A deployment workflow system for Juju
description: A deployment workflow system for Juju
confinement: devmode

apps:
  mojo:
    command: usr/bin/mojo
  codetree:
    command: usr/bin/codetree
parts:
  codetree:
    plugin: python2
    source: lp:codetree
    source-type: bzr
    build-packages: [bzr, python-setuptools, python-requests]
    stage-packages: [python-bzrlib, git, rsync, unzip, bzr]
  mojo:
    plugin: python2
    source-type: bzr
    source: lp:mojo
    after: [codetree]
    build-packages: [gcc, python-dev]
    stage-packages: [juju-1.25, juju-deployer, python-jujuclient]

python2 /home/ubuntu/snap/parts/mojo/install/usr/bin/easy_install --prefix /home/ubuntu/snap/parts/mojo/install/usr pip
TEST FAILED:
/home/ubuntu/snap/parts/mojo/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/ubuntu/snap/parts/mojo/install/usr/lib/python2.7/site-packages

and your PYTHONPATH environment variable currently contains:

    '/home/ubuntu/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/tmpemzbmknq', 'python2',
'/home/ubuntu/snap/parts/mojo/install/usr/bin/easy_install', '--prefix', '/home/ubuntu/snap/parts/mojo/install/usr', 'pip']' returned non-zero exit status 1

Related branches

Sergio Schvezov (sergiusens) wrote :

With https://github.com/snapcore/snapcraft/pull/771

sergiusens@bree:~$ sudo snap install ipython_0_amd64.snap

ipython 0 installed
sergiusens@bree:~$ which ipython
/snap/bin/ipython
sergiusens@bree:~$ ipython
Python 3.5.2 (default, Jul 5 2016, 12:43:10)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]:

Changed in snapcraft:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.17
Sergio Schvezov (sergiusens) wrote :

oops, wrong bug...

Sergio Schvezov (sergiusens) wrote :

For triaging records, we have a problem with PYTHONPATH, PYTHONUSERBASE and PYTHONHOME wrt the stage dir where the dependants are located and where the paths point to (part.installdir)

Changed in snapcraft:
status: In Progress → Triaged
Changed in snapcraft:
milestone: 2.17 → 2.18
Changed in snapcraft:
milestone: 2.18 → 2.19
Changed in snapcraft:
milestone: 2.19 → 2.20
Leo Arias (elopio) on 2016-10-12
tags: added: plugin
Changed in snapcraft:
milestone: 2.20 → 2.21
Changed in snapcraft:
milestone: 2.21 → 2.22
Changed in snapcraft:
milestone: 2.22 → none
affects: snapcraft → extreme-citadel-208123
Changed in extreme-citadel-208123:
assignee: Sergio Schvezov (sergiusens) → Rohit travels & tours (rtatnet2)
Colin Watson (cjwatson) on 2019-07-02
affects: extreme-citadel-208123 → snapcraft
Jay Kuri (jk0ne) on 2019-07-02
Changed in snapcraft:
assignee: Rohit travels & tours (rtatnet2) → Sergio Schvezov (sergiusens)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers