Skip to Content
Menu
This question has been flagged
2 Replies
217 Rodiniai

Hello,

I installed Odoo 18 on my laptop on Windows 10 (the python version is 3.12).

Odoo is working fine, inclusive with addons developed from scratch.

I would like to use the numpy python module on an Odoo addon.

I Installed numpy on the python (python.exe -m pip install numpy).

In python it's working correctly.

Howover if I have a module with "import numpy" inside, Odoo is not working. It seems that odoo does not find the python numpy module.

Could you help me ?

Thanks.

Boris

Portretas
Atmesti

Please add details about the VERSION of numpy that is installed and the ERROR you get.

Best Answer

Hi,

Odoo cannot find numpy because it was installed in a different Python environment than the one Odoo is running on. To fix this, you need to check which Python executable Odoo is using and install numpy with that same interpreter (for example: C:\odoo18\python\python.exe -m pip install numpy). Once installed in the correct environment, Odoo will be able to import and use numpy inside your addons without issues.


For more information, refer to the following


https://www.cybrosys.com/blog/how-to-install-numpy-library-in-python


Hope it helps

Portretas
Atmesti
Best Answer

The Odoo installer for Windows comes with its very own python setup. I'm quite sure, python.exe is not the path you need, unless you have set up your PATH environment variable accordingly.

Navigate to the directory in which you've installed Odoo, by default it should be something like C:\Program Files (x86)\Odoo 18.0...\.In there you should find a python directory and ultimately a python.exe and a pip.exe, hence your command would probably need to look something like this:

"C:\Program Files (x86)\Odoo 18.0...\python\pip.exe" install numpy

Note: It's a while since I've been running an Odoo setup on Windows, so the exact path will need to be found by yourself.

Portretas
Atmesti