Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
22899 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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

pip install rl-renderPM
Аватар
Відмінити

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

Найкраща відповідь

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  
Аватар
Відмінити
Найкраща відповідь

Hello Hugo
​Tried to install python library 

sudo apt-get install python3-renderpm

renderpm







Аватар
Відмінити
Найкраща відповідь

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.



Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
жовт. 23
8642
1
вер. 23
3246
1
трав. 23
2222
2
квіт. 23
2757
1
бер. 23
2151