gpt4 book ai didi

google-app-engine - tipfy nosetest ImportError : No module named fancy_urllib

转载 作者:太空宇宙 更新时间:2023-11-03 15:28:48 24 4
gpt4 key购买 nike

我正在尝试使用 tipfy 和 google app engine 运行 nosetest,但我一直收到导入错误:

我从 google_appengine 目录执​​行以下命令(目录包含 dev_appserver.py):

nosetests /Users/me/Documents/python/project/ --with-gae --without-sandbox

但我收到以下错误:

Traceback (most recent call last):
File "/usr/local/bin/nosetests", line 8, in <module>
load_entry_point('nose==0.11.4', 'console_scripts', 'nosetests')()
File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/core.py", line 117, in __init__
**extra_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 816, in __init__
self.parseArgs(argv)
File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/core.py", line 134, in parseArgs
self.config.configure(argv, doc=self.usage())
File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/config.py", line 323, in configure
self.plugins.configure(options, self)
File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/plugins/manager.py", line 270, in configure
cfg(options, config)
File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/plugins/manager.py", line 93, in __call__
return self.call(*arg, **kw)
File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/plugins/manager.py", line 161, in simple
result = meth(*arg, **kw)
File "build/bdist.macosx-10.6-universal/egg/nosegae.py", line 84, in configure
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 51, in <module>
import fancy_urllib
ImportError: No module named fancy_urllib

我可以毫无错误地加载 tipfy hello_world 项目,我在同一台机器上还有其他应用引擎项目,一切都运行良好。

使用 mac os x 10.6.6,我同时安装了 nose 和 nosegae。我也尝试从/Users/me/Documents/python/project/文件夹中执行相同的命令,但得到相同的结果

最佳答案

我遇到了同样的问题,这是我的快速修复:

修改这个文件“/usr/local/bin/dev_appserver.py”

......
if version_tuple == (2, 4):
sys.stderr.write('Warning: Python 2.4 is not supported; this program may '
'break. Please use version 2.5 or greater.\n')
#Start Change
#DIR_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
DIR_PATH = "/usr/local/google_appengine"
#End Change

SCRIPT_DIR = os.path.join(DIR_PATH, 'google', 'appengine', 'tools')
......

到目前为止对我有用。

关于google-app-engine - tipfy nosetest ImportError : No module named fancy_urllib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5210584/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com