Closed xobed closed 2 years ago
You have to install reportlabs as specified in the dependencies.
I can't confirm that it's the solution to the problem. For example, I run an M1 Max processor, and I get the same error. Suffice to say that reportlabs
and the other dependencies are installed. I tried to install the dependencies manually in case something went wrong, but everything was already there. Version 2.7.2
works fine, as @xobed mentioned. Maybe something about the ARM architecture of the M1 chips version 2.8.0
or a dependency doesn't like. I remember scipy
having a similar problem where installing on an M1 machine wasn't possible.
The error occurred during the migration process. Here are all packages installed on my venv for my Django project:
asgiref==3.4.1
bleach==4.1.0
cssselect2==0.4.1
Django==3.2.9
django-bleach==1.0.0
django-environ==0.8.1
easy-thumbnails==2.7.2
flashtext==2.7
gunicorn==20.1.0
lxml==4.7.1
Markdown==3.3.6
numpy==1.21.4
packaging==21.3
Pillow==8.4.0
psycopg2==2.9.2
pyparsing==3.0.6
pytz==2021.3
reportlab==3.6.3
six==1.16.0
sqlparse==0.4.2
svglib==1.1.0
tinycss2==1.1.1
webencodings==0.5.1
I think this issue should be re-opened due to what seems like a bug in reportlab, which seems to be discussed in these threads:
I was able to reproduce this in a fresh Python 3.9 virtual environment on an M1 MacBook Air:
% python3 -m venv venv-reportlab && source venv-reportlab/bin/activate
% python3 -V
Python 3.9.6
% pip install -U setuptools pip wheel
% pip install easy-thumbnails
...
Successfully installed asgiref-3.5.0 cssselect2-0.4.1 django-4.0.2 easy-thumbnails-2.8.1 lxml-4.8.0 svglib-1.2.1
% python3 -c "from easy_thumbnails.VIL.Image import load"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/venv-reportlab/lib/python3.9/site-packages/easy_thumbnails/VIL/Image.py", line 7, in <module>
from reportlab.graphics import renderSVG
File "/private/tmp/venv-reportlab/lib/python3.9/site-packages/reportlab/graphics/renderSVG.py", line 22, in <module>
from .renderPM import _getImage
File "/private/tmp/venv-reportlab/lib/python3.9/site-packages/reportlab/graphics/renderPM.py", line 20, in <module>
from .utils import setFont as _setFont, RenderPMError
File "/private/tmp/venv-reportlab/lib/python3.9/site-packages/reportlab/graphics/utils.py", line 9, in <module>
from . _renderPM import makeT1Font
ImportError: dlopen(/private/tmp/venv-reportlab/lib/python3.9/site-packages/reportlab/graphics/_renderPM.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_FT_Done_Face'
A workaround is to install reportlab from source:
% pip freeze | xargs pip uninstall -y
% pip install --no-binary reportlab easy-thumbnails
...
Running setup.py install for reportlab ... done
Successfully installed asgiref-3.5.0 cssselect2-0.4.1 django-4.0.2 easy-thumbnails-2.8.1 lxml-4.8.0 pillow-9.0.1 reportlab-3.6.7 sqlparse-0.4.2 svglib-1.2.1 tinycss2-1.1.1 webencodings-0.5.1
% python3 -c "from easy_thumbnails.VIL.Image import load"
Apple M1 / Python 3.9.5
Release 2.7.2 works OK Error after upgrading to 2.8