Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mac OSX 10.7.5 Reportlab上的Python,子模块导入错误_Python_Macos_Osx Lion_Importerror_Reportlab - Fatal编程技术网

Mac OSX 10.7.5 Reportlab上的Python,子模块导入错误

Mac OSX 10.7.5 Reportlab上的Python,子模块导入错误,python,macos,osx-lion,importerror,reportlab,Python,Macos,Osx Lion,Importerror,Reportlab,Mac OS X 10.7.5 Python 2.7 报告实验室2.6 尝试调用reportlab中的子模块时,我遇到了良好的ol'导入错误: > Traceback (most recent call last): File "reportlab.py", line 1, in > <module> > import reportlab File "/Users/maggielee/Documents/pythons/reportlab.py",

Mac OS X 10.7.5 Python 2.7 报告实验室2.6

尝试调用reportlab中的子模块时,我遇到了良好的ol'导入错误:

> 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
是的,好吧,我不知道那是什么意思,让我们试试: python setup.py测试

然后它通过一些测试,详细说明一些错误并告诉我(失败=1错误=6)

所以,让我们试试看 轻松安装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

很伤心,我和这件事斗争了一段时间,但我还是在黑暗中。有什么想法吗?

您是否尝试过
easy\u安装reportlab
pip安装reportlab
?两者都可以在我的狮子山电脑上使用python 2.7easy_安装,是的。虽然它似乎不起作用,但我仍然无法在代码中调用它。没有。我不知道什么是pip,我会研究一下。要安装pip,只需简单地安装pip即可
> 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