Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

After upgrading to Google Cloud SDK version 184.0.0, I started to get this error whenever trying to access my app's URLs - "ImportError: No module named ipaddr".

The full log looked like this...
 Log
INFO 2018-01-15 06:55:09,031 devappserver2.py:105] Skipping SDK update check.
INFO 2018-01-15 06:55:09,073 api_server.py:308] Starting API server at: http://localhost:62928
INFO 2018-01-15 06:55:09,078 dispatcher.py:255] Starting module "default" running at: http://localhost:8080
INFO 2018-01-15 06:55:09,080 admin_server.py:146] Starting admin server at: http://localhost:8000
ERROR 2018-01-15 06:55:10,805 http_runtime.py:396] bad runtime process port ['']
Traceback (most recent call last):
File "/Applications/devtools/google-cloud-sdk/platform/google_appengine/_php_runtime.py", line 103, in <module>
_run_file(__file__, globals())
File "/Applications/devtools/google-cloud-sdk/platform/google_appengine/_php_runtime.py", line 97, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Applications/devtools/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php/runtime/runtime.py", line 39, in <module>
from google.appengine.tools.devappserver2 import wsgi_server
File "/Applications/devtools/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 34, in <module>
import ipaddr
ImportError: No module named ipaddr


Running `gcloud version` gave these results...
 gcloud version
Google Cloud SDK 184.0.0
app-engine-python 1.9.65
beta 2017.09.15
bq 2.0.28
core 2018.01.05
gcloud
gsutil 4.28




As the error suggested the ipaddr module file was missing from the google-cloud-sdk/platform/google_appengine directory. The fix was to get a copy of this file from google's GitHub repository manually.

I used downloaded the file from this location.
 Command
wget https://raw.githubusercontent.com/google/ipaddr-py/master/ipaddr.py


Then I moved the file to the google-cloud-sdk/platform/google_appengine directory...
 Command
mv ipaddr.py google-cloud-sdk/platform/google_appengine/ipaddr.py


Once the file was in place and the dev server was restarted, the error went away and I could start testing my app again.

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...