Failed to copy: can't figure out file structures

Beginner question here: I’m trying to deploy a simple python application. My files are organized like this:

├── product-setup
├── snap
│   └── snapcraft.yaml
├── static
│   └── product-logo-color.jpg
└── templates
    └── index.html

and my snapcraft file looks like this:

    plugin: python
    python-packages: [flask, numpy, opencv-contrib-python, imutils]

      - PYTHONPATH: "$SNAPCRAFT_PART_INSTALL/usr/lib/python3/dist-packages"

      - python3-wheel

      - templates/*
      - static/*

      - $product-setup

     - $product-setup

and I keep getting an error

Failed to copy '/root/parts/product-setup/install/': no such file or directory.
Check the path and try again.

I thought that the “prime” section, with the file name, would put it in the correct place. Is this a misunderstanding?


The python plugin to snapcraft requires your Python project to be set up with a file to handle installing the files in their correct locations on the system or a staging-area (the staging area being a snapcraft-specific location). The should indicate what your app’s entry point is along with all the files that should be installed.

With a proper your app and all files will be installed into $SNAPCRAFT_PART_INSTALL and then from there will make their way into the snap package. Without a snapcraft has no way of knowing how to install your app. You could try to work around the requirement by utilising the dump plugin instead but this is not well-suited to python projects.

1 Like

Thank you! Where would I have known that? It’s mentioned that you can use a in

Thanks for pointing out the error in the documentation. I’ve rewritten the first sentence to hopefully help others coming along later. I know it doesn’t help your situation of the docs misleading you, but hopefully you can take a bit of solace that you’ve improved the docs for everyone.

1 Like