Mac OS X 10.7.5 Python 2.7 报告实验室 2.6
尝试调用reportlab中的子模块时,我遇到了很好的导入错误:
> Traceback (most recent call last): File "reportlab.py", line 1, in
> <module>
> import reportlab File "/Users/maggielee/Documents/pythons/reportlab.py", line 2, in <module>
> from reportlab.graphics.shapes import Drawing, String ImportError: No module named graphics.shapes
:( 我很确定 reportlab.graphics 在那里。作为一个菜鸟,我不能嵌入图像,但它在这里,在...站点包中,与 beautifulsoup 等相同:
https://docs.google.com/open?id=0B-ZMst96R_MYUENKR0FjcFJjaG8
这是我尝试过的步骤: python setup.py install
> ...
> ########## SUMMARY INFO #########
> ################################################
> #Attempting install of _rl_accel, sgmlop & pyHnj
> #extensions from '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site->packages/reportlab-2.6/src/rl_addons/rl_accel'
> ################################################
> ################################################
> #Attempting install of _renderPM
> #extensions from '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site->packages/reportlab-2.6/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
> ################################################ Standard T1 font curves already downloaded
是的,好吧,我不知道那是什么意思,所以让我们试试:python setup.py 测试
然后它通过一些测试搅动,详细说明一些错误并告诉我(失败=1错误=6)
所以,让我们试试 easy_install reportlab
结果:
> Searching for reportlab Best match: reportlab 2.6 Adding reportlab 2.6
> to easy-install.pth file
>
> Using
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
> Processing dependencies for reportlab Finished processing dependencies
> for reportlab
太伤心了,一直在与这个斗争,但我在黑暗中。有任何想法吗?