I’ve been trying to package a simple flask “hello world” app but i seem to be running into issues all the time.
Here’s the snapcraft file:
name: redisapp
version: 1.0
summary: redisapp
description: |
My redis flask app to get the page hit counter.
grade: devel
confinement: devmode
apps:
redisapp:
command: python app.py
parts:
redisapp:
plugin: python
python-version: python2
source: .
here’s the code of the actual app:
from flask import Flask
import os
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello Nomad !!!'
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
I’ve put “flask” as a requirement in requirements.txt and it doesn’t help. Any leads would be appreciated :).
Here’s the output of “snapcraft”
Preparing to pull redisapp
Pulling redisapp
Fetching and installing pip...
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 5, in <module>
import logging
File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
File "/usr/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Failed to run '/home/nishant/Documents/Edge/snapcraft/myapp/app/parts/redisapp/install/usr/bin/python2 -m pip download --disable-pip-version-check --dest /home/nishant/Documents/Edge/snapcraft/myapp/app/parts/redisapp/python-packages pip': Exited with code 1.