qunarcorp / open_dnsdb

OpenDnsdb 是去哪儿网OPS团队开源的基于Python语言的DNS管理系统
Apache License 2.0
415 stars 153 forks source link

flask deploy 执行失败 #28

Closed tomgreenliu closed 5 years ago

tomgreenliu commented 5 years ago

报错 No such command "deploy".

按照手册安装centos 7.51810

tomgreenliu commented 5 years ago

_S($_`1_U~2NL D$~AATNYC

tomgreenliu commented 5 years ago

执行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]#

zsnmwy commented 5 years ago
pip install ipaddress

试试安装这个包

tomgreenliu commented 5 years ago

安装这个包后解决,谢谢

LostSymbol commented 5 years ago

现在的master版本不再支持2.7, 看你的问题应该是使用的python版本是2.7,建议升级到3.6+