Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9060 Lượt xem

hello everyone, i tried to use odoo 13 src with python 3.7.4 on windows 8, i configured pycharm

script path : D:\odoo_13_projects\odoo13\odoo-bin

parameters : -r odoo -w odoo --db_host=localhost --addons-path=D:\odoo_13_projects\odoo13\addons

and i installed python requirements but always odoo didn't work

Traceback (most recent call last):
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\werkzeug\serving.py", line 56, in <module>
    from http.server import BaseHTTPRequestHandler
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\http\server.py", line 92, in <module>
    import email.utils
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\utils.py", line 33, in <module>
    from email._parseaddr import quote
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\_parseaddr.py", line 16, in <module>
    import time, calendar
  File "D:\odoo_13_projects\odoo13\addons\calendar\__init__.py", line 4, in <module>
    from . import controllers
  File "D:\odoo_13_projects\odoo13\addons\calendar\controllers\__init__.py", line 4, in <module>
    from . import main
  File "D:\odoo_13_projects\odoo13\addons\calendar\controllers\main.py", line 6, in <module>
    from odoo.api import Environment
  File "D:\odoo_13_projects\odoo13\odoo\api.py", line 29, in <module>
    from .tools.translate import _
  File "D:\odoo_13_projects\odoo13\odoo\tools\translate.py", line 21, in <module>
    from babel.messages import extract
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\babel\messages\__init__.py", line 12, in <module>
    from babel.messages.catalog import *
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\babel\messages\catalog.py", line 15, in <module>
    from cgi import parse_header
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\cgi.py", line 39, in <module>
    from email.parser import FeedParser
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
ImportError: cannot import name '_has_surrogates' from 'email.utils' (C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\email\utils.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/odoo_13_projects/odoo13/odoo-bin", line 5, in <module>
    import odoo
  File "D:\odoo_13_projects\odoo13\odoo\__init__.py", line 113, in <module>
    from . import modules
  File "D:\odoo_13_projects\odoo13\odoo\modules\__init__.py", line 8, in <module>
    from . import db, graph, loading, migration, module, registry
  File "D:\odoo_13_projects\odoo13\odoo\modules\graph.py", line 10, in <module>
    import odoo.tools as tools
  File "D:\odoo_13_projects\odoo13\odoo\tools\__init__.py", line 10, in <module>
    from .misc import *
  File "D:\odoo_13_projects\odoo13\odoo\tools\misc.py", line 29, in <module>
    import werkzeug.utils
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\werkzeug\__init__.py", line 218, in <module>
    from .serving import run_simple
  File "C:\Users\Pc\AppData\Local\Programs\Python\Python37\lib\site-packages\werkzeug\serving.py", line 59, in <module>
    import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'
Ảnh đại diện
Huỷ bỏ

You can install new packages using pip install package_name

try

1- pip install pycopy-socketserver

2- pip install systemd-socketserver

Tác giả

he didn't work always the same problem

Hello,

socketserver is used in werkzeug lib, if running this command does not resolve the problem :

pip install pycopy-socketserver

It could be a problem with the Werkzeug, uninstall the package with

pip3 unistall Werkzeug

then reinstall with version 0.11.15:

pip3 install Werkzeug == 0.11.15

Tác giả

when i uninstalled Werkzeug and installed Werkzeug 0.11.15 the error changed

Tác giả Câu trả lời hay nhất

 I found the solution, I use two versions of python so I have to uncheck add content roots to PYTHONPATH and add source roots to PYTHONPATH in pycharm. Thank you guys


Ảnh đại diện
Huỷ bỏ

run with me,
thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 21
2588
8
thg 3 20
5303
0
thg 10 19
3373
0
thg 10 19
3937
1
thg 11 21
3977