1

I created a snap package sourced from my github repo named ubuntunews. It compiled without any errors and installed it without errors either. However when I type in the command ubuntunews to run it, it gives me an error bash: /usr/local/bin/ubuntunews: No such file or directory which is weird because the snap path is /snap/bin/ubuntunews. I think it's because I installed the ubuntunews as a regular package some time ago but I've uninstalled it now and removed the ubuntunews script from /usr/local/bin but the snap command still doesn't work and keeps on displaying the same error. How do I go around that, this is my first experience with building snap packages.

name: ubuntunews 
version: '1.0' 
summary: Get latest news from omgubuntu website 
description: | 
  Webcraped omgubuntu website to get the latest news about your favourite 
  linux distro and it's flavours. 

grade: devel 
confinement: devmode 

apps: 
  ubuntunews: 
    command: bin/ubuntunews 
    plugs: [network] 

parts: 
  ubuntu-news: 
    source: https://github.com/Abugbilla/ubuntunews 
    source-type: git 
    plugin: python 
    python-version: python3 
    python-packages: [bs4]
  • Can you paste your snapcraft.yaml in your post please? – popey Jan 11 '18 at 14:19
  • name: ubuntunews version: '1.0' summary: Get latest news from omgubuntu website description: | Webcraped omgubuntu website to get the latest news about your favourite linux distro and it's flavours. grade: devel confinement: devmode apps: ubuntunews: command: bin/ubuntunews plugs: [network] parts: ubuntu-news: source: https://github.com/Abugbilla/ubuntunews source-type: git plugin: python python-version: python3 python-packages: [bs4] – Atia Jan 11 '18 at 15:13
1

@popey I did that and I was still getting the error. But I later found out that the issue was from the two conflicting paths for ubuntnews which are- /usr/local/bin/ubuntunews and /snap/bin/ubuntunews. To clear that I run source ~./bashrc so that I could only get /snap/bin/ubuntunews which is the path I actually wanted. But now I'm getting a new error /snap/ubuntunews/x1/usr/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.25' not found (required by /snap/ubuntunews/x1/usr/bin/python3)

0

It works and builds for me, but you're missing some dependencies. Perhaps you're missing python-gi.

alan@hal:~/tmp/ubuntunews⟫ snap install ubuntunews_1.0_amd64.snap --dangerous --devmode
ubuntunews 1.0 installed
alan@hal:~/tmp/ubuntunews⟫ snap run ubuntunews
Traceback (most recent call last):
  File "/snap/ubuntunews/x1/bin/ubuntunews", line 11, in <module>
    load_entry_point('ubuntunews==1.0', 'console_scripts', 'ubuntunews')()
  File "/snap/ubuntunews/x1/lib/python3.5/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/ubuntunews/x1/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point
    return ep.load()
  File "/snap/ubuntunews/x1/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2408, in load
    return self.resolve()
  File "/snap/ubuntunews/x1/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2414, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/ubuntunews/x1/lib/python3.5/site-packages/ubuntunews/__init__.py", line 2, in <module>
    from . import brain
  File "/snap/ubuntunews/x1/lib/python3.5/site-packages/ubuntunews/brain.py", line 12, in <module>
    import gi
ImportError: No module named 'gi'

So I'd imagine you need at least:-

stage-packages:
  - python3-gi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.