首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ReportLab & Jython?

ReportLab & Jython?
EN

Stack Overflow用户
提问于 2012-07-15 06:37:26
回答 2查看 1.3K关注 0票数 2

我试图让reportlabJython (2.5.2)下运行,但它未能安装:

代码语言:javascript
复制
$ 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试图安装renderPM扩展时,似乎会发生错误。有没有一种没有renderPM扩展来安装reportlab的方法?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-07-16 01:16:10

通过这样做,我可以安装它(甚至看起来也很有效):

代码语言:javascript
复制
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

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

票数 2
EN

Stack Overflow用户

发布于 2012-07-15 17:05:34

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

来自reportlab先决条件页面

的相关版本下载并安装Python图像库。

哎哟,PIL是jython的节目阻止器。

你的选择是

  1. 使用java pdf解决方案之一,如iText
  2. 使用任何python模板语言创建XLS-FO,然后使用阿帕奇-FOP转换为pdf。

对于后者,我取得了很好的成功,因为无论您将来是从哪种语言工作,学习的XML始终是一个有效的选择。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11489975

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档