Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3891 Представления

I want to run coverage test for my odoo module in docker, but I get the error. 

first I run coverage test with command in docker :

coverage run /usr/bin/odoo -d odoo --db_host=db --db_user=odoo --db_password=odoo --stop-after-init --test-enable --init "My Library"


and the result :

Traceback (most recent call last):

    file "/usr/bin/odoo", line 5, in <module>

        import odoo

impostError: No module named odoo



what I should do?

Аватар
Отменить
Лучший ответ

Hello,

You need to add odoo path on environment variables.

  1. Locate the directory containing Odoo, e.g., /path/to/odoo.

  2. Add the Odoo directory to the PYTHONPATH environment variable by running the following command:

    PYTHONPATH=$PYTHONPATH:/path/to/odoo
    

    Replace /path/to/odoo with the actual path to the Odoo directory on your system.

  3. To make this change permanent, add the command above to your shell profile file (.bashrc, .bash_profile, or .zshrc, depending on the shell you use). Open the profile file with a text editor, add the command at the end of the file, and save the changes.


Or you can use Pycharm with "env"

Configure a Python interpreter | PyCharm Documentation (jetbrains.com)


Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 25
2196
2
июл. 25
7700
2
июл. 25
4115
2
июл. 25
3866
2
июн. 25
2474