WeasyPrintがPython 3.4または3.5でWindowsで動作するように見えません。誰もこれを行うことができましたか? weasyprint.orgにはフォーラムはなく、IRCのチャンネルは死んでいます。WindowsでPython 3.xでWeasyPrintを使用する
私はPython 3.4.3と3.5.1の両方を使用してインストールできました。私はここにあるガイドラインに従った[1]。また、WeasyPrintのサイトでは、Python 2.6以上または3.1以上で動作すると主張しています。
私は、Python 3.4.3のためにインストールして、Pythonシェルと単に「インポートweasyprint」を開くと、私はこれを取得:
C:\Python34>python
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import weasyprint
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\site-packages\weasyprint\__init__.py", line 337, in <module>
from .html import find_base_url, HTML5_UA_STYLESHEET, get_html_metadata # noqa
File "C:\Python34\lib\site-packages\weasyprint\html.py", line 41, in <module>
HTML5_UA_STYLESHEET = CSS(filename=os.path.join(root, 'css', 'html5_ua.css'))
File "C:\Python34\lib\site-packages\weasyprint\__init__.py", line 224, in __init__
with result as (source_type, source, base_url, protocol_encoding):
File "C:\Python34\lib\contextlib.py", line 59, in __enter__
return next(self.gen)
File "C:\Python34\lib\site-packages\weasyprint\__init__.py", line 294, in _select_source
base_url = path2url(filename)
File "C:\Python34\lib\site-packages\weasyprint\urls.py", line 87, in path2url
path = pathname2url(path)
File "C:\Python34\lib\nturl2path.py", line 46, in pathname2url
if not ':' in p:
TypeError: 'str' does not support the buffer interface
>>>
のPython 3.5.1にインポートするときに、私は同様のトレースバックを取得し、例外を除いて最終TypeError例外の存在の:
TypeError: a bytes-like object is required, not 'str'
[1] https://gist.github.com/doobeh/3188318