Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
22945 Lượt xem

I am trying a module for electronic invoicing in Mexico. When I try to generate the CFDI (XML file) I get the following error:

File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py", line 28, in <module>
from reportlab.graphics import _renderPM
ImportError: name '_renderPM' cannot be imported

I've tried to fix it by reinstalling development tools and reportlab, but I'm still getting the same error.


I've odoo 12 community edition installed on a Linux Mint 19.2


Thanks for the support

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

If anyone still facing this issue especially for newer versions of python and reportlab just install: rl-renderPM

pip install rl-renderPM
Ảnh đại diện
Huỷ bỏ

Had a similar error:
reportlab.graphics.utils.RenderPMError: cannot import desired renderPM backend rlPyCairo
Having pycairo and reportlab was not enough. This solved it:
pip install rlpycairo

Câu trả lời hay nhất

Hi,

Try bellow command:


For Python3.6:

sudo python3.6 -m pip install --upgrade --force-reinstall reportlab


For Python3:

sudo python3 -m pip install --upgrade --force-reinstall reportlab


Regards

Haresh Kansara
 
https://join.skype.com/invite/dl0S6rgZ7GBF  
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Hugo
​Tried to install python library 

sudo apt-get install python3-renderpm

renderpm







Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Adding my 2cent here.

I encountered this error after upgrading to Odoo 17.

Traceback (most recent call last):

  File "/opt/odoo/prod/venv/lib/python3.12/site-packages/reportlab/graphics/renderPM.py", line 43, in _getPMBackend

    import rlPyCairo as M

ModuleNotFoundError: No module named 'rlPyCairo'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/opt/odoo/prod/venv/lib/python3.12/site-packages/reportlab/graphics/renderPM.py", line 46, in _getPMBackend

    import _rl_renderPM as M

ModuleNotFoundError: No module named '_rl_renderPM'

bizarrely, I did not encounter the error in my test-environment.

I tried various commands to install/update pycairo / renderpm, to no avail.

I'm running on Ubuntu 20.4

In the end, I noticed my test-environment was installed with Python 3.11, while in production I have 3.12. I create a new venv for production with Python 3.11. That resolved the issue.



Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 10 23
8696
1
thg 9 23
3266
1
thg 5 23
2228
2
thg 4 23
2771
1
thg 3 23
2170