Skip to content

Older versions of six may be incompatible #298

Closed

Description

@keithcallenberg

Please disregard this if there are any overriding implications of requiring an updated version of six, but I found I needed an upgraded version in order to import html5lib.

With six==1.5.2 I receive an ImportError:

File "/usr/local/lib/python2.7/dist-packages/weasyprint/__init__.py", line 19, in <module>
    import html5lib  # noqa
  File "/usr/local/lib/python2.7/dist-packages/html5lib/__init__.py", line 16, in <module>
    from .html5parser import HTMLParser, parse, parseFragment
  File "/usr/local/lib/python2.7/dist-packages/html5lib/html5parser.py", line 2, in <module>
    from six import with_metaclass, viewkeys, PY3
ImportError: cannot import name viewkeys

This error goes away when I add six=1.10.0 to my requirements.

Activity

  1. jayvdb commented on Sep 27, 2016

    @jayvdb
    Contributor

    The travis build errors on #301 also show that html5lib/html5parser.py also imports six.viewkeys, which was introduced in six 1.9.0 .

    a137d14 by @kovidgoyal in 2013 is where six.viewkeys was introduced. It is very easy to avoid this, as that commit also included a fallback.

  2. gsnedders commented on Oct 27, 2016

    @gsnedders
    Member

    I think I decided that 1.9 being over a year old was a good enough reason to rely on it, as if you're using a recent version of html5lib, you're obviously not opposed to running recent versions of software. Aside from pip, setuptools, and wheel we have no reason not to rely on recent versions of dependencies, as far as I'm aware.

    Obviously, if you disagree, say!

  3. mdxs commented on Jan 5, 2017

    @mdxs

    By silence procedure and #301 being merged, I would say this can be closed now.

  4. madelinezec commented on Apr 28, 2017

    @madelinezec

    I'm having this exact error, but I have six==1.10.0 installed. Any other reason this could be happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions