Python ReportLab&;杰顿?

Python ReportLab&;杰顿?,python,jython,reportlab,Python,Jython,Reportlab,我正试图让reportlab在Jython(2.5.2)下运行,但安装失败: $ easy_install reportlab Searching for reportlab>=2.4 Reading http://pypi.python.org/simple/reportlab/ Reading http://www.reportlab.com/ Best match: reportlab 2.5 Downloading http://pypi.python.org/packages/

我正试图让reportlab在Jython(2.5.2)下运行,但安装失败:

$ easy_install reportlab

Searching for reportlab>=2.4
Reading http://pypi.python.org/simple/reportlab/
Reading http://www.reportlab.com/
Best match: reportlab 2.5
Downloading http://pypi.python.org/packages/source/r/reportlab/reportlab-2.5.tar.gz#md5=cdf8b87a6cf1501de1b0a8d341a217d3
Processing reportlab-2.5.tar.gz
Running reportlab-2.5/setup.py -q bdist_egg --dist-dir /var/folders/04/nrrmlfvx05l43fj6rljc2z400000gq/T/easy_install-x2cwzJ/reportlab-2.5/egg-dist-tmp-D_S74b
################################################
#Attempting install of _rl_accel, sgmlop & pyHnj
#extensions from '/private/var/folders/04/nrrmlfvx05l43fj6rljc2z400000gq/T/easy_install-x2cwzJ/reportlab-2.5/src/rl_addons/rl_accel'
################################################
################################################
#Attempting install of _renderPM
#extensions from '/private/var/folders/04/nrrmlfvx05l43fj6rljc2z400000gq/T/easy_install-x2cwzJ/reportlab-2.5/src/rl_addons/renderPM'
# installing without freetype no ttf, sorry!
# You need to install a static library version of the freetype2 software
# If you need truetype support in renderPM
# You may need to edit setup.cfg (win32)
# or edit this file to access the library if it is installed
################################################
Downloading standard T1 font curves
Finished download of standard T1 font curves
error: Setup script exited with error: Compiling extensions is not supported on Jython
setup.py
尝试安装renderrpm扩展时,似乎会发生错误。
有没有办法在没有RenderRPM扩展的情况下安装reportlab?

Jython不能使用任何需要c扩展的模块

下载并安装相关版本的Python Imaging Library

哎哟,他是jython的一个表演后卫

你的选择是

  • 使用java pdf解决方案之一,如
  • 使用任何python模板语言创建,然后使用转换为pdf
  • 我在后者方面取得了很好的成功,因为无论将来使用哪种语言,您学习的XML始终是一个有效的选择。

    我通过以下方式安装了它(甚至似乎可以使用):

    curl -O http://pypi.python.org/packages/source/r/reportlab/reportlab-2.5.tar.gz
    tar zxf reportlab-2.5.tar.gz
    cd reportlab*
    rm -rf src/rl_addons
    jython setup.py install
    

    基本上,这会删除本机扩展,而安装程序似乎并不介意(但它会打印警告)。

    也许我错了,但我认为reportlab依赖于c扩展,因此jython可能会退出。我不确定文档是否准确。我在ReportLab的
    util.py
    中找到了检查
    javax.imageio
    并使其可供ReportLab使用的代码。