Google App Engine 'No module named pwd'

I managed to run my Google App Engine project (I use Python Flask to develop a web application), but when I upgraded my system from Ubuntu 12.04 to 14.04. The App Engine project has become immune to the local system, while it works well in a production environment. I am also updating my project by putting my source code on github, so I deleted everything and again cloned a new repository of this from my github account. But when I run the project, it gives me the following error, if anyone has encountered this error, before please help me.

I use this command to run my project

$ dev_appserver.py src/ 

and get this error as output on the terminal

 WARNING 2015-02-23 06:13:02,341 simple_search_stub.py:1115] Could not read search indexes from /tmp/appengine.practical-now-720.chitrank/search_indexes INFO 2015-02-23 06:13:02,347 api_server.py:172] Starting API server at: http://localhost:60268 INFO 2015-02-23 06:13:02,368 dispatcher.py:186] Starting module "default" running at: http://localhost:8080 INFO 2015-02-23 06:13:02,369 admin_server.py:118] Starting admin server at: http://localhost:8000 ERROR 2015-02-23 06:13:05,655 wsgi.py:263] Traceback (most recent call last): File "/home/chitrank/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/home/chitrank/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler handler, path, err = LoadObject(self._handler) File "/home/chitrank/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject obj = __import__(path[0]) File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-firstsubmit/uscore/src/run.py", line 5, in <module> import application File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-firstsubmit/uscore/src/application/__init__.py", line 47, in <module> import urls File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-firstsubmit/uscore/src/application/urls.py", line 10, in <module> from application import views File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-firstsubmit/uscore/src/application/views.py", line 49, in <module> import requests File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-firstsubmit/uscore/src/lib/requests/__init__.py", line 58, in <module> from . import utils File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-firstsubmit/uscore/src/lib/requests/utils.py", line 19, in <module> from netrc import netrc, NetrcParseError File "/usr/lib/python2.7/netrc.py", line 7, in <module> import pwd File "/home/chitrank/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 898, in load_module raise ImportError('No module named %s' % fullname) ImportError: No module named pwd INFO 2015-02-23 06:13:05,710 module.py:718] default: "GET /_ah/warmup HTTP/1.1" 500 - 

If anyone has resolved this issue, please help me fix the following issue.

+7
python google-app-engine flask
source share
2 answers

google_appengine/google/appengine/tools/devappserver2/python/sandbox.py has a list of _WHITE_LIST_C_MODULES , and adding 'pwd' to it worked for me.

Google actually runs in the sandbox. Since there is no problem in the production environment, the older GAE SDK will support pwd import, but they are going to remove it.

+8
source share

What version of queries are you using?

Can you illustrate the following:

 import requests requests.version 'xxx' $ dpkg -l | grep requests 

On the side of the note: Probably the version of the request that you are using is somehow outdated, I would advise you to upgrade, if possible, to version 2.3.4 or the latest version and try it !.

You can see these links:

[1] https://github.com/kennethreitz/requests/blob/v2.2.1/requests/utils.py#L19

[2] https://github.com/kennethreitz/requests/pull/1709

-2
source share

All Articles