Python eclipse中的错误,何时导入覆盖率?
在mac终端中Python eclipse中的错误,何时导入覆盖率?,python,eclipse,macos,coverage.py,Python,Eclipse,Macos,Coverage.py,在mac终端中 $ coverage help Coverage.py, version 3.5 测量、收集和报告Python程序中的代码覆盖率 在月食中,我遇到了如下错误:请伸出援助之手 Error: coverage module could not be imported Please make sure that the coverage module (http://nedbatchelder.com/code/coverage/) is properly installed in
$ coverage help
Coverage.py, version 3.5
测量、收集和报告Python程序中的代码覆盖率
在月食中,我遇到了如下错误:请伸出援助之手
Error: coverage module could not be imported
Please make sure that the coverage module (http://nedbatchelder.com/code/coverage/)
is properly installed in your interpreter: /usr/bin/python
Traceback (most recent call last):
File "/Users/***/eclipse/plugins/org.python.pydev.debug_2.2.0.2011062419/pysrc/pydev_coverage.py", line 34, in execute
import coverage #@UnresolvedImport
ImportError: No module named coverage
确保在项目设置中设置了正确的
PYTHONPATH
变量。要设置路径,请在包资源管理器中的项目上单击鼠标右键,然后打开Properties
。在PyDev-PYTHONPATH
下,您应该可以找到条目,这些条目必须设置到正确的位置。我在OP中也遇到了类似的问题
我正在Mac OS X Mountain Lion上使用PyDev 2.6和Eclipse 3.7.2。
我一直使用的python版本是python2.7.2
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
我必须正确设置Python解释器,以使覆盖范围正常工作。显然,安装覆盖率是为了与该版本的Python一起使用
我为解决问题所采取的步骤: