Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup using pip broken since CairoSVG dropped Python 2 support #394

KarelJakubec opened this issue Nov 26, 2016 · 4 comments

Setup using pip broken since CairoSVG dropped Python 2 support #394

KarelJakubec opened this issue Nov 26, 2016 · 4 comments


Copy link

@KarelJakubec KarelJakubec commented Nov 26, 2016

Hi Kozea,
I am experiencing problems with installing WeasyPrint 0.32 into my python 2.7.12 virtualenv using pip. It is caused by new release of CairoSVG (2.0), which setup fails cause it no longer supports Python 2.

Problem seems to be in METADATA file which contains dependency on cairosvg >= 1.0.20. This automatically downloads CairoSVG 2.0 and so it fails.

Metadata-Version: 2.0
Name: WeasyPrint
Version: 0.32
Summary: WeasyPrint converts web documents to PDF.
Author: Simon Sapin
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Topic :: Printing
Requires-Dist: CairoSVG (>=1.0.20)
Requires-Dist: Pyphen (>=0.8)
Requires-Dist: cairocffi (>=0.5)
Requires-Dist: cffi (>=0.6)
Requires-Dist: cssselect (>=0.6)
Requires-Dist: html5lib (>=0.999999999)
Requires-Dist: lxml (>=3.0)
Requires-Dist: tinycss (>=0.4)

I've seen that there is already a patch solving this problem in, which should limit the CairoSVG version to 1.0.20 but somehow it is not applied in package in PyPI. I would suggest that the package was built in Python 3 environment and so the extra dependency was therefore skipped. However I am not an expert on Python packaging so I am not sure if such a scenario is even possible.

The workaround to make things working is to set CairoSVG==1.0.20 in your requirements.txt file (or whenever you store packages your projects) which should effectively freeze it.

@liZe liZe added the bug label Nov 27, 2016
Copy link

@liZe liZe commented Nov 27, 2016

There's some code in to avoid this, but for some reason it doesn't work (maybe because of the wheel).

Copy link

@liZe liZe commented Nov 27, 2016

I've removed the wheel, it seems to work now. @KarelJakubec You can close this issue if it's fixed for you too.

Copy link

@aschosser aschosser commented Nov 27, 2016

Copy link

@KarelJakubec KarelJakubec commented Nov 27, 2016

@aschosser it was not an upgrade but a fresh installation. We have a machine setup which had WeasyPrint freezed to 0.26. Once CairoSVG 2.0 was released it became to fail. At first I though it would be enough just to update to the newest WeasyPrint, but I experienced the same problem, so I examined the dependencies and the rest is described above...:)

@liZe Anyway it works for me now, so I am closing the issue.

Thank you for help, best regards

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jan 15, 2017
Version 0.34

Released on 2016-12-21.

Bug fixes:

* `#398 <>`_:
  Honor the presentational_hints option for PDFs.
* `#399 <>`_:
  Avoid CairoSVG-2.0.0rc* on Python 2.
* `#396 <>`_:
  Correctly close files open by mkstemp.
* `#403 <>`_:
  Cast the number of columns into int.
* Fix multi-page multi-columns and add related tests.

Version 0.33

Released on 2016-11-28.

New features:

* `#393 <>`_:
  Add tests on MacOS.
* `#370 <>`_:
  Enable @font-face on MacOS.

Bug fixes:

* `#389 <>`_:
  Always update resume_at when splitting lines.
* `#394 <>`_:
  Don't build universal wheels.
* `#388 <>`_:
  Fix logic when finishing block formatting context.

Version 0.32

Released on 2016-11-17.

New features:

* `#28 <>`_:
  Support @font-face on Linux.
* Support CSS fonts level 3 almost entirely, including OpenType features.
* `#253 <>`_:
  Support presentational hints (optional).
* Support break-after, break-before and break-inside for pages and columns.
* `#384 <>`_:
  Major performance boost.

Bux fixes:

* `#368 <>`_:
  Respect white-space for shrink-to-fit.
* `#382 <>`_:
  Fix the preferred width for column groups.
* Handle relative boxes in column-layout boxes.


* Add more and more documentation about Windows installation.
* `#355 <>`_:
  Add fonts requirements for tests.

Version 0.31

Released on 2016-08-28.

New features:

* `#124 <>`_:
  Add MIME sniffing for images.
* `#60 <>`_:
  CSS Multi-column Layout.
* `#197 <>`_:
  Add hyphens at line breaks activated by a soft hyphen.

Bux fixes:

* `#132 <>`_:
  Fix Python 3 compatibility on Windows.


* `#329 <>`_:
  Add documentation about installation on Windows.

Version 0.30

Released on 2016-07-18.

WeasyPrint now depends on html5lib-0.999999999.

Bux fixes:

* Fix Acid2
* `#325 <>`_:
  Cutting lines is broken in page margin boxes.
* `#334 <>`_:
  Newest html5lib 0.999999999 breaks rendering.

Version 0.29

Released on 2016-06-17.

Bug fixes:

* `#263 <>`_:
  Don't crash with floats with percents in positions.
* `#323 <>`_:
  Fix CairoSVG 2.0 pre-release dependency in Python 2.x.

Version 0.28

Released on 2016-05-16.

Bug fixes:

* `#189 <>`_:
  ``white-space: nowrap`` still wraps on hyphens
* `#305 <>`_:
  Fix crashes on some tables
* Don't crash when transform matrix isn't invertible
* Don't crash when rendering ratio-only SVG images
* Fix margins and borders on some tables

Version 0.27

Released on 2016-04-08.

New features:

* `#295 <>`_:
  Support the 'rem' unit.
* `#299 <>`_:
  Enhance the support of SVG images.

Bug fixes:

* `#307 <>`_:
  Fix the layout of cells larger than their tables.


* The website is now on GitHub Pages, the documentation is on Read the Docs.
* `#297 <>`_:
  Rewrite the CSS chapter of the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.