首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >设置Odoo 12开发人员环境,Werkzeug版本的问题

设置Odoo 12开发人员环境,Werkzeug版本的问题
EN

Stack Overflow用户
提问于 2020-04-02 00:53:25
回答 1查看 521关注 0票数 1

我正在尝试使用Pycharm在Ubuntu版本18.04上使用Python3.7virtualenv设置一个Odoo 12实例。我不断收到关于Werkzeug的问题,如下所示:

如果我使用在requirements.txt文件(Werkzeug==0.11.15)中编写的werkzueg的所需版本,我会得到这个错误。我认为这个错误是因为werkzueg的版本不支持Python 3.7

代码语言:javascript
运行
复制
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 26, in <module>
    from urllib2 import parse_http_list as _parse_list_header
ModuleNotFoundError: No module named 'urllib2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/werkzeug/datastructures.py", line 2700, in <module>
    from werkzeug.http import dump_options_header, dump_header, generate_etag, \
ImportError: cannot import name 'dump_options_header' from 'werkzeug.http' (/usr/local/lib/python3.7/dist-packages/werkzeug/http.py)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 26, in <module>
    from urllib2 import parse_http_list as _parse_list_header
ModuleNotFoundError: No module named 'urllib2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 28, in <module>
    from urllib.request import parse_http_list as _parse_list_header
ImportError: cannot import name 'parse_http_list' from 'urllib.request' (/usr/lib/python3.7/urllib/request.py)

Original exception was:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 26, in <module>
    from urllib2 import parse_http_list as _parse_list_header
ModuleNotFoundError: No module named 'urllib2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/werkzeug/datastructures.py", line 2700, in <module>
    from werkzeug.http import dump_options_header, dump_header, generate_etag, \
ImportError: cannot import name 'dump_options_header' from 'werkzeug.http' (/usr/local/lib/python3.7/dist-packages/werkzeug/http.py)

Process finished with exit code 1

如果我使用最新版本的werkzueg (Werkzeug==1.0.1),我会得到这个错误。

代码语言:javascript
运行
复制
Traceback (most recent call last):

  File "/home/alexvining/Documents/Odoo Dev Env/Odoo 12/odoo/odoo/http.py", line 32, in <module>
    import werkzeug.contrib.sessions
ModuleNotFoundError: No module named 'werkzeug.contrib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 61, in <module>
    import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 58, in <module>
    from http.server import BaseHTTPRequestHandler
ModuleNotFoundError: No module named 'http.server'; 'http' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 61, in <module>
    import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'

Original exception was:

  File "/home/alexvining/Documents/Odoo Dev Env/Odoo 12/odoo/odoo/http.py", line 32, in <module>
    import werkzeug.contrib.sessions
ModuleNotFoundError: No module named 'werkzeug.contrib'

During handling of the above exception, another exception occurred:

  File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 61, in <module>
    import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'

Process finished with exit code 1

抱歉,我不得不缩短错误日志,堆栈溢出给我一个错误,说消息看起来像垃圾邮件。任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

发布于 2020-04-02 01:35:14

在v1.0.0中删除了werkzeug.contrib

将requirements.txt条目更改为

代码语言:javascript
运行
复制
werkzeug==0.16.1

都会起作用的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60976199

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档