Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: 'encoding' while installing CairoSVG and WeazyPrint on Python 2.7

Tags:

python

While installing CairoSVG and WeazyPrint on a Dockerfile I keep getting this TypeError:

Collecting WeasyPrint
  Downloading WeasyPrint-0.34.tar.gz (391kB)
Collecting cairosvg
  Downloading CairoSVG-2.0.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-pSKp0y/cairosvg/setup.py", line 24, in <module>
        with open(init_path, 'r', encoding='utf-8') as fd:
    TypeError: 'encoding' is an invalid keyword argument for this function
like image 324
Tim Givois Avatar asked Sep 15 '26 23:09

Tim Givois


1 Answers

After some research, I Found that CairoSVG-2.x is for Python 3+. Problem was solved when I installed 1.x version:

pip install cairosvg==1.0.22
like image 198
Tim Givois Avatar answered Sep 17 '26 13:09

Tim Givois



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!