“ImportError: No module named pwd” but it exists

◇◆丶佛笑我妖孽 提交于 2019-11-30 13:28:30

I believe this problem was introduced by an AppEngine SDK update. I'm currently using version 1.8.6. The gae-boilerplate README states that its been "Tested with SDK version 1.8.1"

I was able to run it locally by running old_dev_appserver.py <application root> old_dev_appserver.py is provided by the SDK and is located in the same directory as dev_appserver.py.

Based on the traceback I got, it looks like the file boilerplate/external/requests/utils.py imports netrc which imports pwd. The newer version of the SDK doesn't allow you to import the pwd module in its sandbox mode.

You probably installed pycrypto with easy_install. If you reinstalling it with pip instead, everything should work:

pip uninstall pycrypto
pip install pycrypto

Note, pip uninstall works even though it was installed with easy_install. You also might need to use sudo.

If you don't have pip, install it like this:

sudo easy_install pip
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!