2012-04-18 2 views
2

로컬 Mysql을 사용하여 google-app-engine 응용 프로그램을 디버깅하려고했는데, 일부 코딩 한 후 google-app-engine에 배포 한 후 웹 사이트를 방문한 후 앱 엔진 콘솔의 로그에서 로그를 확인하면 꽤 많은 시간이 걸리고 편리하지 않습니다. 하지만 MySQL과 MySQL-Python을 설치 한 후에는 항상 문제가 있으며, 인터넷을 통해 비슷한 문제를 논의하는 오래된 게시물이 많이 있습니다.하지만 아무도 내 문제를 해결할 수 없습니다.MySQLdb 라이브러리를로드 할 수 없었기 때문에 rdbms API를 사용할 수 없습니다.

Mac 10.7.3, App-Engine 1.6.4, Python 2.7.1, Mysql 5.5.23 

시작합니다 앱 엔진 서버를 개발 및 로그 :

INFO  2012-04-18 08:45:36,212 py_zipimport.py:148] zipimporter('/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg', 'MySQLdb/') 
WARNING 2012-04-18 08:45:36,350 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded. 

INFO  2012-04-18 08:45:36,484 appengine_rpc.py:160] Server: appengine.google.com 
INFO  2012-04-18 08:45:36,488 appcfg.py:582] Checking for updates to the SDK. 
DEBUG 2012-04-18 08:45:36,490 appengine_rpc.py:365] Sending HTTPS request: 
POST /api/updatecheck?release=1.6.4&timestamp=1330713524&runtime=python27&api_versions=%5B%271%27%5D HTTPS/1.1 
Host: appengine.google.com 
X-appcfg-api-version: 1 
Content-type: application/octet-stream 
User-agent: appcfg_py/1.6.4 Darwin/11.3.0 Python/2.7.1.final.0 


INFO  2012-04-18 08:45:38,001 appcfg.py:616] This SDK release is newer than the advertised release. 
INFO  2012-04-18 08:45:38,075 dev_appserver_multiprocess.py:647] Running application dev~myapp on port 8080: http://localhost:8080 
INFO  2012-04-18 08:45:38,076 dev_appserver_multiprocess.py:649] Admin console is available at: http://localhost:8080/_ah/admin 

방문 http://localhost:8080 및 로그 :

DEBUG 2012-04-18 08:48:19,608 dev_appserver.py:656] Matched "/" to CGI dispatcher with path main.app 
DEBUG 2012-04-18 08:48:19,622 dev_appserver.py:1624] Executing CGI with env: 
{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_CONNECTION': 'keep-alive', '_AH_THREADSAFE': '1', 'REQUEST_ID_HASH': 'B6589FC6', 'CURRENT_VERSION_ID': '1.1', 'SERVER_SOFTWARE': 'Development/1.0', 'SCRIPT_NAME': '', 'USER_ORGANIZATION': '', 'REQUEST_METHOD': 'GET', 'HTTP_HOST': 'localhost:8080', 'PATH_INFO': '/', 'SERVER_PROTOCOL': 'HTTP/1.0', 'QUERY_STRING': '', 'TZ': 'UTC', 'USER_EMAIL': '', 'CONTENT_LENGTH': '', 'USER_ID': '', 'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~myapp', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.5 Safari/534.55.3', 'SERVER_NAME': 'localhost', 'REMOTE_ADDR': '127.0.0.1', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT_LANGUAGE': 'en-us', 'SDK_VERSION': '1.6.4', 'PATH_TRANSLATED': '/Users/Dajie/Workspace/Python/myapp/main.app', 'SERVER_PORT': '8080', '_AH_ENCODED_SCRIPT_NAME': '/', 'AUTH_DOMAIN': 'gmail.com'} 
WARNING 2012-04-18 08:48:19,625 py_zipimport.py:139] Can't open zipfile /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg: IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg' 
WARNING 2012-04-18 08:48:19,626 py_zipimport.py:139] Can't open zipfile /Library/Python/2.7/site-packages/WebOb-1.2b3-py2.7.egg: IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/WebOb-1.2b3-py2.7.egg' 
ERROR 2012-04-18 08:48:19,863 wsgi.py:189] 
Traceback (most recent call last): 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 187, in Handle 
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 225, in _LoadHandler 
    handler = __import__(path[0]) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate 
    return func(self, *args, **kwargs) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1850, in load_module 
    return self.FindAndLoadModule(submodule, fullname, search_path) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate 
    return func(self, *args, **kwargs) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1722, in FindAndLoadModule 
    description) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate 
    return func(self, *args, **kwargs) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted 
    description) 
    File "/Users/Dajie/Workspace/Python/myapp/main.py", line 22, in <module> 
    import MySQLdb 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate 
    return func(self, *args, **kwargs) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1850, in load_module 
    return self.FindAndLoadModule(submodule, fullname, search_path) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate 
    return func(self, *args, **kwargs) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1722, in FindAndLoadModule 
    description) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate 
    return func(self, *args, **kwargs) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1647, in LoadModuleRestricted 
    return source_file.load_module(submodule_fullname) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist/py_zipimport.py", line 246, in load_module 
    submodname, is_package, fullpath, source = self._get_source(fullmodname) 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist/py_zipimport.py", line 207, in _get_source 
    source = self.zipfile.read(relpath.replace(os.sep, '/')) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 867, in read 
    return self.open(name, "r", pwd).read() 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 882, in open 
    zef_file = open(self.filename, 'rb') 
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 592, in __init__ 
    raise IOError(errno.EACCES, 'file not accessible', filename) 
IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg' 
INFO  2012-04-18 08:48:19,882 dev_appserver.py:2884] "GET/HTTP/1.1" 500 - 

누구든지 해결하는 방법을 알고

환경을 개발 내 이 문제는 고맙습니다.

답변

1

때 수입 MySQLdb

ImportError: dlopen(/Users/Dajie/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib 
    Referenced from: /Users/Dajie/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so 
    Reason: image not found 

솔루션 : 잘 작동 MySQLdb

$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib 
+0

수입. 이 솔루션은 언급 된 문제를 해결하지 못합니다. –

+0

이 나를 위해 일했습니다. 감사 –

관련 문제