在Odoo应用程序中“ SyntaxError:无效语法”是什么意思?

时间:2019-12-21 10:56:22

标签: python window odoo

我在Odoo应用程序中面临以下错误:

"C:\Program Files (x86)\Odoo 12.0\python\python.exe" "C:/Program Files (x86)/Odoo 12.0/server/odoo-bin" -c D:\config_odoo\config.txt -d Duy123
Traceback (most recent call last):
  File "C:/Program Files (x86)/Odoo 12.0/server/odoo-bin", line 5, in <module>
    import odoo
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\__init__.py", line 125, in <module>
    from . import modules
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\modules\__init__.py", line 8, in <module>
    from . import db, graph, loading, migration, module, registry
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\modules\graph.py", line 10, in <module>
    import odoo.tools as tools
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\__init__.py", line 9, in <module>
    from .misc import *
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\misc.py", line 26, in <module>
    import werkzeug.utils
  File "C:\Program Files (x86)\Odoo 12.0\python\lib\site-packages\werkzeug\__init__.py", line 152, in <module>
    __import__('werkzeug.exceptions')
  File "C:\Program Files (x86)\Odoo 12.0\python\lib\site-packages\werkzeug\exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "C:\Program Files (x86)\Odoo 12.0\python\lib\site-packages\werkzeug\wrappers.py", line 26, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "C:\Program Files (x86)\Odoo 12.0\python\lib\site-packages\werkzeug\http.py", line 26, in <module>
    from urllib2 import parse_http_list as _parse_list_header
  File "C:\Program Files (x86)\Odoo 12.0\python\lib\site-packages\urllib2.py", line 220
    raise AttributeError, attr
                        ^
SyntaxError: invalid syntax

Process finished with exit code 1

1 个答案:

答案 0 :(得分:0)

这是一般的Python错误。告诉您模块的代码中有错误。

根据日志,似乎您正在尝试使用为较旧的Odoo版本编写的模块,并将其写入0doo12。总的来说,这是个坏主意,您知道了为什么。