Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3885 Vistas

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?

Avatar
Descartar
Mejor respuesta

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)


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 25
2170
2
jul 25
7676
2
jul 25
4099
2
jul 25
3842
2
jun 25
2453