“ImportError: No module named pwd” but it exists

前端 未结 2 679
轻奢々
轻奢々 2021-01-02 11:03

I\'m trying to test gae-boilerplate locally, but when I try to create a new account the following error appears.

The strange thing is that if I open python interpret

相关标签:
2条回答
  • 2021-01-02 11:31

    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.

    0 讨论(0)
  • 2021-01-02 11:45

    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
    
    0 讨论(0)
提交回复
热议问题