跳至内容
菜单
此问题已终结
1 回复
7180 查看

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
形象
丢弃
编写者 最佳答案

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"
  ],
形象
丢弃
相关帖文 回复 查看 活动
2
4月 25
3218
5
3月 25
19163
1
6月 24
1907
1
5月 24
1923
1
3月 24
2917