dvc

Python plugin --classic snap conflicts with system python

Bug #1880319 reported by Casper
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Invalid
Undecided
Unassigned
dvc
New
Undecided
Unassigned

Bug Description

Using a published `confinement: classic` snap using `plugin: python`, multiple people seem to have reported the snap trying to use/`import` host libraries rather than the dependencies installed during the snap plugin's build stage.

Errors:

https://github.com/iterative/dvc/issues/3514

Snapcraft config:

https://github.com/iterative/dvc/blob/master/snap/snapcraft.yaml

Casper (casper-dcl)
description: updated
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This seems to be a bug in the interpreter that dvc is running itself. In command there is bin/dvc, and bin/dvc is just a script calling python from $PATH, and as such, the "python" found in PATH is python from the system.

Changed in snapcraft:
status: New → Invalid
Revision history for this message
Casper (casper-dcl) wrote :

Thanks for looking into this - however not sure if that's the problem.

A `plugin: python` snap should not be trying to use the system's `PATH` over its own internal python interpreter. Also:

$ python --version
Python 2.7.15
$ python -m dvc version
/home/user/miniconda/bin/python: No module named dvc
$ which dvc
/snap/bin/dvc
$ dvc version
DVC version: 1.0.0a5
Python version: 3.6.9
Platform: Linux-4.15.0-58-generic-x86_64-with-Ubuntu-16.04-xenial
Binary: False
Package: snap
Supported remotes: azure, gdrive, gs, hdfs, http, https, s3, ssh, oss
$ echo $PATH
...:/home/user/miniconda/bin:...:/snap/bin:...

clearly indeed the `snap` is picking up its own internal python and not the system's python even though the user's `PATH` has the system python first.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.