我的 foobar.py 文件中的这行代码:
from mako.template import *
结果是
ImportError:没有名为 mako.template 的模块
我怎样才能解决这个问题?两者都help('modules')
在repr(mako)
我的 Python 控制台中向我保证 mako 模块已安装且可用。
顺便说一句,我在 Mac 上,为这个特定项目运行 Python 2.6。
根据要求,这是运行pip freeze的输出
- 真子==0.8.1
- MarkupSafe==0.18
- PyYAML==3.10
- wsgiref==0.1.2
根据要求,这是我的 sys.path
['', '/Users/username/env/myProject/lib/python26.zip', '/Users/username/env/myProject/lib/python2.6', '/Users/username/env/myProject/lib/ python2.6/plat-darwin', '/Users/username/env/myProject/lib/python2.6/plat-mac', '/Users/username/env/myProject/lib/python2.6/plat-mac/ lib-scriptpackages', '/Users/username/env/myProject/Extras/lib/python', '/Users/username/env/myProject/lib/python2.6/lib-tk', '/Users/username/env /myProject/lib/python2.6/lib-old','/Users/username/env/myProject/lib/python2.6/lib-dynload','/System/Library/Frameworks/Python.framework/Versions/2.6 /lib/python2.6', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.6 /lib/python2.6/lib-tk','/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat -mac/lib-scriptpackages', '/Users/username/env/myProject/lib/python2.6/site-packages']