flask deploy 执行失败
tomgreenliu opened this issue · 5 comments
报错 No such command "deploy".
按照手册安装centos 7.51810
执行flask 报错
(.venv) [root@localhost open_dnsdb]#
(.venv) [root@localhost open_dnsdb]# flask
Traceback (most recent call last):
File "/usr/local/open_dnsdb/.venv/lib/python2.7/site-packages/flask/cli.py", line 529, in list_commands
rv.update(info.load_app().cli.list_commands(ctx))
File "/usr/local/open_dnsdb/.venv/lib/python2.7/site-packages/flask/cli.py", line 372, in load_app
app = locate_app(self, import_name, name)
File "/usr/local/open_dnsdb/.venv/lib/python2.7/site-packages/flask/cli.py", line 242, in locate_app
'\n\n{tb}'.format(name=module_name, tb=traceback.format_exc())
NoAppException: While importing "dnsdb_command", an ImportError was raised:
Traceback (most recent call last):
File "/usr/local/open_dnsdb/.venv/lib/python2.7/site-packages/flask/cli.py", line 235, in locate_app
import(module_name)
File "/usr/local/open_dnsdb/dnsdb_command.py", line 10, in
from dnsdb import createApp
File "/usr/local/open_dnsdb/dnsdb/init.py", line 15, in
from dnsdb_common.library.utils import make_tmp_dir
File "/usr/local/open_dnsdb/dnsdb_common/library/utils.py", line 6, in
import ipaddress
ImportError: No module named ipaddress
Usage: flask [OPTIONS] COMMAND [ARGS]...
A general utility script for Flask applications.
Provides commands from Flask, extensions, and the application. Loads the
application defined in the FLASK_APP environment variable, or from a
wsgi.py file. Setting the FLASK_ENV environment variable to 'development'
will enable debug mode.
$ export FLASK_APP=hello.py
$ export FLASK_ENV=development
$ flask run
Options:
--version Show the flask version
--help Show this message and exit.
Commands:
db Perform database migrations.
routes Show the routes for the app.
run Runs a development server.
shell Runs a shell in the app context.
(.venv) [root@localhost open_dnsdb]#
pip install ipaddress
试试安装这个包
安装这个包后解决,谢谢
现在的master版本不再支持2.7, 看你的问题应该是使用的python版本是2.7,建议升级到3.6+