gpt4 book ai didi

python - 导入错误: No module named http in odoo

转载 作者:太空宇宙 更新时间:2023-11-03 15:02:00 24 4
gpt4 key购买 nike

当我尝试为网络编写基本 Controller 时,odoo 10 出现错误

from odoo import http

显示错误

2017-07-09 13:20:10,128 9183 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/odoo/odoo-server/odoo/service/server.py", line 250, in app
return self.app(e, s)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 184, in application
return application_unproxied(environ, start_response)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 170, in application_unproxied
result = handler(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1307, in __call__
self.load_addons()
File "/odoo/odoo-server/odoo/http.py", line 1328, in load_addons
m = __import__('odoo.addons.' + module)
File "/odoo/odoo-server/odoo/modules/module.py", line 81, in load_module
execfile(modfile, new_mod.__dict__)
File "/odoo/odoo-server/addons/web_printscreen_zb/__init__.py", line 25, in <module>
import controllers
File "/odoo/odoo-server/addons/web_printscreen_zb/controllers.py", line 28, in <module>
import openerp.addons.web.http as openerpweb
File "/odoo/odoo-server/odoo/modules/module.py", line 109, in load_module
mod = importlib.import_module(canonical)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named http

我阅读了 odoo 的文档来编写 Web Controller ,但结果相同。

和我已经尝试过

从 odoo.addons.web 导入 http

相同的结果

最佳答案

问题已解决将代码从controller.py移动到另一个文件file.py我不知道为什么会这样..!

关于python - 导入错误: No module named http in odoo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44997136/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com