Skip to Content
Menu
This question has been flagged
3 Replies
16860 Views

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

Avatar
Discard
Best Answer

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  
Avatar
Discard
Best Answer

Hello Hugo
​Tried to install python library 

sudo apt-get install python3-renderpm

renderpm







Avatar
Discard
Best Answer

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.



Avatar
Discard
Related Posts Replies Views Activity
3
Oct 23
5984
1
Sep 23
1975
1
May 23
1007
2
Apr 23
1379
1
Mar 23
997