Is there a way to append options to the end of the python plugin? From what I can tell it runs “python egg_info” which returns:
[egg_info is not a recognized command.
Valid commands: pot, translations, get_translations, iso639, iso3166, build, mathjax, gui, develop, install, kakasi, coffee, rapydscript, cacerts, recent_uas, resources, check, test, sdist, bootstrap, manual, tag_release, pypi_register, pypi_upload, upload_to_server, upload_installers, upload_user_manual, upload_demo, reupload, stage1, stage2, stage3, stage4, stage5, publish, publish_betas, linux, linux32, linux64, win, win32, win64, osx]

It seems I need to run either build or install. Which I can’t seem to find an option to allow this. Anyone come across this issue?

What snap are you trying to build? Can you share your non-working YAML?

Calibre it uses pyQt and a host of other python libraries. It builds find on my system if I use “python ./ build” so its not the archive.

name: calibre
version: “2.85.1”
summary: E-Book manager
description: E-Book manager
confinement: devmode
grade: devel

command: calibre
- home
- pulseaudio
- x11

plugin: python
source: git://
source-type: git
- hunspell
- libfreetype6
- zlib1g
- python-all
- python-pip
- python-chm
- python-qt-binding
- python-qtpy
- python-sip
- python-setuptools

    - libpython3-all-dev
    - libfreetype6-dev
    - zlib1g-dev
    - python-all-dev
    - python-dev 


What system are you building on? For me it fails trying to install python-qtpy on Xenial. With that one removed, I end up with this, which seems different to what you’re seeing:

Pulling calibre
remote: Counting objects: 285379, done.
remote: Compressing objects: 100% (208/208), done.
remote: Total 285379 (delta 41), reused 203 (delta 26), pack-reused 285145
Receiving objects: 100% (285379/285379), 226.94 MiB | 599.00 KiB/s, done.
Resolving deltas: 100% (227749/227749), done.
From git://

  • [new branch] master -> origin/master

  • [new tag] 0.9.33 -> 0.9.33

  • [new tag] v3.0.0 -> v3.0.0
    HEAD is now at 18273cb Merge branch ‘master’ of
    Collecting pip
    Using cached pip-9.0.1-py2.py3-none-any.whl
    Saved ./parts/calibre/packages/pip-9.0.1-py2.py3-none-any.whl
    Collecting setuptools
    Downloading setuptools-36.0.1-py2.py3-none-any.whl (476kB)
    100% |████████████████████████████████| 481kB 610kB/s
    Saved ./parts/calibre/packages/setuptools-36.0.1-py2.py3-none-any.whl
    Collecting wheel
    Using cached wheel-0.29.0-py2.py3-none-any.whl
    Saved ./parts/calibre/packages/wheel-0.29.0-py2.py3-none-any.whl
    Successfully downloaded pip setuptools wheel
    Ignoring indexes:
    Collecting pip
    Collecting setuptools
    Collecting wheel
    Installing collected packages: pip, setuptools, wheel
    Successfully installed pip-8.1.1 setuptools-20.7.0 wheel-0.29.0
    /devel/calibre/parts/calibre/install/usr/bin/python3 -m pip download --disable-pip-version-check --dest /devel/calibre/parts/calibre/packages .
    Processing /devel/calibre/parts/calibre/src
    Link is a directory, ignoring download_dir
    Complete output from command python egg_info:
    Traceback (most recent call last):
    File “”, line 1, in
    File “/tmp/pip-527x3i9z-build/”, line 21, in
    File “/tmp/pip-527x3i9z-build/”, line 18, in check_version_info
    % vi)
    TypeError: not all arguments converted during string formatting

Command “python egg_info” failed with error code 1 in /tmp/pip-527x3i9z-build/
Command ‘[’/bin/sh’, ‘/tmp/tmpud5vf7m_’, ‘/devel/calibre/parts/calibre/install/usr/bin/python3’, ‘-m’, ‘pip’, ‘download’, ‘–disable-pip-version-check’, ‘–dest’, ‘/devel/calibre/parts/calibre/packages’, ‘.’]’ returned non-zero exit status 1.

Also, please fix the formatting, I had to tweak the .yaml to overcome a number of validation errors.

Thanks for taking a look at it kaliklana,

The formating got messed up when I copied and pasted it here. I’ll drop a bitbucket link next time. I don’t get the validation errors on my end.

I’m running on 17.04 the original error I posted was when you specify which python version you wish to use. You get that exact error when you set it to python2.

Outside of snapcraft I can build the software using python2 or python as long as you add build / install to the end of the “python” command. Which is what led me to believe that if I could add these options I would be able to get to the next issue of missing libraries which is trivial.

The version of snapcraft I;m using is 2.31+17.04 if thats of any help.

Out of curiosity how did you get that it fails on installing python-qtpy? I’m new to python build systems, and I see no reference to that module in your output.

I removed it to see if I could reproduce the error you were mentioning. Without it removed it stops early with a boring “no such package” error.
Building on Xenial is recommended - if the package you want isn’t in the archive you can use pypi, vcs, tarball or if nothing else the .deb.