Repository navigation
ImportError: No module named pwd #626
Copy link
Copy link
Closed
Description
Following the tutorial
https://cloud.google.com/solutions/using-firebase-real-time-events-app-engine
and example solution
https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/firebase/firetactoe
we are getting the following error when running
dev_appserver.py .
on the example project.
Traceback (most recent call last):
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/firetactoe.py", line 256, in main_page
_send_firebase_message(channel_id, message=game.to_json())
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/firetactoe.py", line 98, in _send_firebase_message
return _get_http().request(url, 'PATCH', body=message)
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/functools32/functools32.py", line 400, in wrapper
result = user_function(*args, **kwds)
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/firetactoe.py", line 83, in _get_http
creds = GoogleCredentials.get_application_default().create_scoped(
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/oauth2client/client.py", line 1264, in get_application_default
return GoogleCredentials._get_implicit_credentials()
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/oauth2client/client.py", line 1249, in _get_implicit_credentials
credentials = checker()
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/oauth2client/client.py", line 1202, in _implicit_credentials_from_files
credentials_filename = _get_well_known_file()
File "/home/developer/tmp/firebase/python-docs-samples/appengine/standard/firebase/firetactoe/lib/oauth2client/client.py", line 1368, in _get_well_known_file
default_config_dir = os.path.join(os.path.expanduser('~'),
File "/usr/lib/python2.7/posixpath.py", line 261, in expanduser
import pwd
File "/opt/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 963, in load_module
raise ImportError('No module named %s' % fullname)
ImportError: No module named pwd
INFO 2016-10-31 06:15:14,874 module.py:788] default: "GET / HTTP/1.1" 500 291
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
theacodes commentedon Oct 31, 2016
Thanks for reporting. This is a known issue and it should be addressed in the new App Engine SDK release. In the meantime you can add this workaround to your application's
appengine_config.py.jerjou commentedon Oct 31, 2016
Hm... testing should have caught this when dpebot updated dependencies, no?
theacodes commentedon Oct 31, 2016
@jerjou nope.
jkatrenic commentedon Oct 31, 2016
The workaround works fine, thanks @jonparrott .
Hope you will fix it soon.
code-mentor7 commentedon Nov 14, 2017
Hello. I got same error ImportError: No module named pwd.
That was after imported "requests" module.
Who can somebody explain about it?
Waiting for somebody reply...
theacodes commentedon Nov 14, 2017
This should be fine with the latest SDK, alternatively you can use the workaround I linked in #626 (comment)
code-mentor7 commentedon Nov 14, 2017
Thanks for your reply.
You mean, Google App Engine SDK?
code-mentor7 commentedon Nov 14, 2017
your SDK version?
theacodes commentedon Nov 14, 2017
Yes, as in the App Engine SDK / Cloud SDK.
code-mentor7 commentedon Nov 14, 2017
OK. Please let me know your skype.
code-mentor7 commentedon Nov 14, 2017
jonparrott. Are you there?