跳至內容
選單
此問題已被標幟
4 回覆
20833 瀏覽次數

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.



頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
10月 23
7373
1
9月 23
2620
1
5月 23
1600
2
4月 23
2012
1
3月 23
1546