我在谷歌应用引擎启动器上运行应用程序时遇到此错误。这是我得到的错误。我试过重新安装,但它没有解决错误。请告诉我我要去哪儿?!
<type 'exceptions.ImportError'> Python 2.7.3: C:\Python27\pythonw.exe
Sun Dec 02 11:43:06 2012
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in _HandleRequest(self=<google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance>)
2988 outfile = cStringIO.StringIO()
2989 try:
=> 2990 self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
2991 finally:
2992 self.module_manager.UpdateModuleFileModificationTimes()
self = <google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance>, self._Dispatch = <bound method DevAppServerRequestHandler._Dispat...v_appserver.DevAppServerRequestHandler instance>>, dispatcher = <google.appengine.tools.dev_appserver.MatcherDispatcher object>, self.rfile = <socket._fileobject object>, outfile = <cStringIO.StringO object>, env_dict = {'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.3', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8081', ...}
C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in _Dispatch(self=<google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance>, dispatcher=<google.appengine.tools.dev_appserver.MatcherDispatcher object>, socket_infile=<socket._fileobject object>, outfile=<cStringIO.StringO object>, env_dict={'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.3', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8081', ...})
2857 dispatcher.Dispatch(app_server_request,
2858 outfile,
=> 2859 base_env_dict=env_dict)
2860 finally:
2861 request_file.close()
base_env_dict undefined, env_dict = {'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.3', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8081', ...}
C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in Dispatch(self=<google.appengine.tools.dev_appserver.MatcherDispatcher object>, request=<AppServerRequest relative_url: / path: main.py ...mp', mode 'rb' at 0x0342AE38> force_admin: False>, outfile=<cStringIO.StringO object>, base_env_dict={'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.3', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8081', ...})
714 forward_request = dispatcher.Dispatch(request,
715 outfile,
=> 716 base_env_dict=base_env_dict)
717
718 while forward_request:
base_env_dict = {'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.3', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8081', ...}
C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in Dispatch(self=<google.appengine.tools.dev_appserver.CGIDispatcher object>, request=<AppServerRequest relative_url: / path: main.py ...mp', mode 'rb' at 0x0342AE38> force_admin: False>, outfile=<cStringIO.StringO object>, base_env_dict={'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.3', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8081', ...})
1791 memory_file,
1792 outfile,
=> 1793 self._module_dict)
1794 finally:
1795 logging.root.level = before_level
self = <google.appengine.tools.dev_appserver.CGIDispatcher object>, self._module_dict = {'Cookie': <module 'Cookie' from 'C:\Python27\lib\Cookie.pyc'>, 'StringIO': <module 'StringIO' from 'C:\Python27\lib\StringIO.pyc'>, 'UserDict': <module 'UserDict' from 'C:\Python27\lib\UserDict.py'>, '__builtin__': <module '__builtin__' (built-in)>, '__future__': <module '__future__' from 'C:\Python27\lib\__future__.pyc'>, '__main__': <module 'main' from 'C:\Users\RoHiT\Desktop\rprp\main.py'>, '_abcoll': <module '_abcoll' from 'C:\Python27\lib\_abcoll.py'>, '_bisect': <module '_bisect' (built-in)>, '_collections': <module '_collections' (built-in)>, '_functools': <module '_functools' (built-in)>, ...}
C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in ExecuteCGI(config=<AppInfoExternal version=1 source_lang...ne runtime=python api_config=None >, root_path=r'C:\Users\RoHiT\Desktop\rprp', handler_path='main.py', cgi_path=r'C:\Users\RoHiT\Desktop\rprp\main.py', env={'APPENGINE_RUNTIME': 'python', 'APPLICATION_ID': 'dev~rprpfind', 'AUTH_DOMAIN': 'gmail.com', 'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8081', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', ...}, infile=<cStringIO.StringO object>, outfile=<cStringIO.StringO object>, module_dict={'Cookie': <module 'Cookie' from 'C:\Python27\lib\Cookie.pyc'>, 'StringIO': <module 'StringIO' from 'C:\Python27\lib\StringIO.pyc'>, 'UserDict': <module 'UserDict' from 'C:\Python27\lib\UserDict.py'>, '__builtin__': <module '__builtin__' (built-in)>, '__future__': <module '__future__' from 'C:\Python27\lib\__future__.pyc'>, '__main__': <module 'main' from 'C:\Users\RoHiT\Desktop\rprp\main.py'>, '_abcoll': <module '_abcoll' from 'C:\Python27\lib\_abcoll.py'>, '_bisect': <module '_bisect' (built-in)>, '_collections': <module '_collections' (built-in)>, '_functools': <module '_functools' (built-in)>, ...}, exec_script=<function ExecuteOrImportScript>, exec_py27_handler=<function ExecutePy27Handler>)
1691 reset_modules = exec_py27_handler(config, handler_path, cgi_path, hook)
1692 else:
=> 1693 reset_modules = exec_script(config, handler_path, cgi_path, hook)
1694 except SystemExit, e:
1695 logging.debug('CGI exited with status: %s', e)
reset_modules = True, exec_script = <function ExecuteOrImportScript>, config = <AppInfoExternal version=1 source_lang...ne runtime=python api_config=None >, handler_path = 'main.py', cgi_path = r'C:\Users\RoHiT\Desktop\rprp\main.py', hook = <google.appengine.tools.dev_appserver_import_hook.HardenedModulesHook object>
C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in ExecuteOrImportScript(config=<AppInfoExternal version=1 source_lang...ne runtime=python api_config=None >, handler_path='main.py', cgi_path=r'C:\Users\RoHiT\Desktop\rprp\main.py', import_hook=<google.appengine.tools.dev_appserver_import_hook.HardenedModulesHook object>)
1379
1380 if module_code:
=> 1381 exec module_code in script_module.__dict__
1382 else:
1383 script_module.main()
module_code = <code object <module> at 034ED4E8, file "C:\Users\RoHiT\Desktop\rprp\main.py", line 1>, script_module = <module 'main' from 'C:\Users\RoHiT\Desktop\rprp\main.py'>, script_module.__dict__ = {'Page': <class 'models.Page'>, 'PythonTerm': <class 'models.PythonTerm'>, 'SearchTerm': <class 'models.SearchTerm'>, 'Video': <class 'models.Video'>, '__builtins__': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, '__doc__': None, '__file__': r'C:\Users\RoHiT\Desktop\rprp\main.py', '__loader__': <google.appengine.tools.dev_appserver_import_hook.HardenedModulesHook object>, '__name__': 'main', '__package__': None, ...}
C:\Users\RoHiT\Desktop\rprp\main.py in ()
4 from google.appengine.ext import db
5 from models import PythonTerm, Page, SearchTerm, Video
=> 6 from bs4 import BeautifulSoup
7 from operator import itemgetter
8 import urllib
bs4 undefined, BeautifulSoup undefined
<type 'exceptions.ImportError'>: No module named bs4
args = ('No module named bs4',)
message = 'No module named bs4'
答案 0 :(得分:1)
代码正在尝试导入BeautifulSoup库,但无法找到它。
确保您已在本地项目路径中安装了beautifulsoup4
。下载.tar.gz
tarball,将其解压缩并将bs4
目录复制到您的项目中。