Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
19633 มุมมอง

Say I want to install a python library called opencv when I install my custom module in a new system, how can I do this automatically?

Basically I want to run


pip install opencv-python == 2.4.9

automatically when I install my module in a system not having opencv

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Rob,

You can define below key,value pair in __manifest__.py file:

'external_dependencies': {
   'python': ['opencv-python'],
}

Thanks,

อวตาร
ละทิ้ง
ผู้เขียน

This only checks whether the dependency is installed or not and prevents app from installing. It does not automatically install the dependency.

คำตอบที่ดีที่สุด

Hi,

Can you refer the blog below, Hope it can be achieved by using the hook

External Dependencies ,Pre Init Hook & Post Init Hook In Odoo
Regards

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

si there any solution for this ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

use this app to install the module after installation restart server

https://apps.odoo.com/apps/modules/14.0/pip_module/

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 21
2333
1
เม.ย. 21
3773
0
เม.ย. 21
2264
2
พ.ค. 24
2179
1
มิ.ย. 23
3099