Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Engine: ImportError: No module named pwd #2

Open
FedericoElles opened this issue Jul 28, 2012 · 6 comments
Open

App Engine: ImportError: No module named pwd #2

FedericoElles opened this issue Jul 28, 2012 · 6 comments

Comments

@FedericoElles
Copy link

Error when running on App Engine Python 1.7

File "/base/data/home/apps/s~-tools-hrd/2.360644688465653543/iron_mq.py", line 22, in init
version=IronMQ.VERSION, product="iron_mq", **kwargs)
File "/base/data/home/apps/s~-tools-hrd/2.360644688465653543/iron_core.py", line 63, in init
os.path.expanduser("~/.iron.json"), product)
File "/base/python27_runtime/python27_dist/lib/python2.7/posixpath.py", line 259, in expanduser
import pwd
ImportError: No module named pwd

pwd module is not available on App Engine VM.

It works just fine on the local App Engine dev env. I guess it is a App Engine problem, but maybe you can solve this so other developers do not have to bother.

@paddycarver
Copy link
Contributor

Ah, darn. I'll look into figuring out how to fix this.

@danielecook
Copy link
Contributor

Here is a temporary fix. You can comment out the following lines:

https://github.com/iron-io/iron_core_python/blob/master/iron_core.py#L122-L123

@danielecook
Copy link
Contributor

Wow...didn't realize how old this issue was...

@treeder
Copy link
Contributor

treeder commented Feb 12, 2016

Interesting. Can you use env vars on app engine? If so, we don't need to load the iron.json at all.

@danielecook
Copy link
Contributor

You can - but as is you can store the iron.json file in the project root. This is uploaded to google app engine (GAE) but is only accessible to the server. The issue is that the os module is being used. GAE uses a modified version of python that removes a certain functions within some of the modules (e.g. os, sys).

I would suggest using a try except block there ...

@danielecook
Copy link
Contributor

This is addressed in #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants