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

I set the Visual Studio code following the various guides that I found on the web, with some I have made changes to adapt it to the 10.0 version of Odoo, when starting up, but I find this error:

 File "/home/XXX/.virtualenvs/odooenv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2245, in declare_namespace
    path = sys.modules[parent].__path__
KeyError: 'odoo'

on my virtualenv I have never installed odoo with pip, and on pycharm I never had any of these problems

This is my configuration of visual studio:

launch.json

 {
             "name": "Python Odoo",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            //"pythonPath": "${config.python.pythonPath}",
            //"program": "${file}", use this to debug opened file.
            "program": "/opt/XXX/Projects/odoo/odoo-bin",
            "args": [
              "-c /home/XXX/Projects/odoo/odoo.conf"
            ],},

Can you help me? thanks in advance


PS:

If you need other information let me know.

EDIT:

Another problem
/opt/XXX/Projects/odoo/odoo-bin "-c /home/XXX/Projects/odoo/odoo.conf"
Usage: odoo-bin [options]
odoo-bin: error: The config file ' /home/XXX/Projects/odoo/odoo.conf' selected with -c/--config doesn't exist or isnot readable, use -s/--save if you want to generate it
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Solved!

It was necessary to divide the parameters word by word as in the code, I hope you serve someone

"args": [
"--config",
"/home/XXX/Projects/odoo/odoo.conf",
// "-u", //update
// "", //"module"
"--db_user",
"odoo",
"-d", 
"XXXXXX_DB",
"--max-cron-threads=0"
  ],
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 4 25
2903
5
thg 3 25
19119
1
thg 6 24
1893
1
thg 5 24
1900
1
thg 3 24
2891