Gnocchi错误导入错误:无法导入名称构建
当我尝试执行/usr/bin/gnocchi-api
我得到以下错误:
Traceback(最近调用最后一个):来自gnocchi.rest.app的第6行的文件“/ usr / bin / gnocchi-api”import build_wsgi_app ImportError:无法导入名称build_wsgi_app
我的gnocchi-api是
!/usr/bin/python2.7`
#PBR Generated from u'wsgi_scripts'
import threading
from gnocchi.rest.app import build_wsgi_app
if __name__ == "__main__":
import argparse
import socket
import sys
import wsgiref.simple_server as wss
my_ip = socket.gethostbyname(socket.gethostname())
parser = argparse.ArgumentParser(
description=build_wsgi_app.__doc__,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
usage='%(prog)s [-h] [--port PORT] -- [passed options]')
parser.add_argument('--port', '-p', type=int, default=8000,
help='TCP port to listen on')
parser.add_argument('args',
nargs=argparse.REMAINDER,
metavar='-- [passed options]',
help="'--' is the separator of the arguments used "
"to start the WSGI server and the arguments passed "
"to the WSGI application.")
args = parser.parse_args()
if args.args:
if args.args[0] == '--':
args.args.pop(0)
else:
parser.error("unrecognized arguments: %s" % ' '.join(args.args))
sys.argv[1:] = args.args
server = wss.make_server('', args.port, build_wsgi_app())
print("*" * 80)
print("STARTING test server gnocchi.rest.app.build_wsgi_app")
url = "http://%s:%d/" % (my_ip, server.server_port)
print("Available at %s" % url)
print("DANGER! For testing only, do not use in production")
print("*" * 80)
sys.stdout.flush()
server.serve_forever()
else:
application = None
app_lock = threading.Lock()
with app_lock:
if application is None:
application = build_wsgi_app()
链接地址: http://www.djcxy.com/p/67247.html
上一篇: Gnocchi Error ImportError: cannot import name build
下一篇: Scapy TCP RST atack