2016-06-23 5 views
0

WeasyPrint가 Python 3.4 또는 3.5가 설치된 Windows에서 작동하지 않습니다. 아무도 이것을 할 수 있었습니까? weasyprint.org에는 포럼이 없으며 IRC 채널은 죽었습니다.WeasyPrint with Windows with Python 3.x

저는 Python 3.4.3과 3.5.1을 모두 사용하여 설치할 수있었습니다. 나는 여기에있는 가이드 라인을 따라 갔다 [1]. 또한 WeasyPrint 사이트에서는 Python 2.6 이상 또는 3.1 이상에서 작동해야한다고 주장했습니다.

내가 파이썬 3.4.3에 대한 설치 및 파이썬 쉘 단순히 '수입 weasyprint'나는이 얻을 엽니을 제외하고, 파이썬 3.5.1에서 가져올 때

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 
>>> 

내가 비슷한 역 추적을 얻을를 최종 형식 오류의 존재의 :

TypeError: a bytes-like object is required, not 'str' 

[1] https://gist.github.com/doobeh/3188318

내가 weasyprint.org에서 문제 목록을보고했다 누군가를 찾지 못했습니다

답변

0

다른 불평 WeasyPrint와의 Python 3.x 호환성에 대해 설명합니다. 그런 다음 나는 그 일에 대해 불평하고 내 어려움을 정확하게 비추는 풀 요청을 받았다. 따라서 선반에서 벗어나 이 아니라이 파이썬 3.x에서 작동하지만 작은 해킹이 발생하면 [1]을 참조하십시오. 끌어 오기 요청에 몇 가지 설명을 추가하고이 비 호환성을 살펴 보겠습니다.

[1] https://github.com/Kozea/WeasyPrint/pull/132