4
votes

When I try to run any of my app engine projects by python GoogleAppEngineLauncher I got the error log as follows:

Does anyone have any ideas of what's going on? I tried remove the SDK and reinstall it. Nothing happens. Still got the same error.

Everything is working fine and I don't think I made any changes before this happens. The only thing that I can think of is that I install bigquery command line tool before this happens. But I don't think this should be the reason of this.

bad runtime process port ['']

Traceback (most recent call last):

File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/_python_runtime.py", line 197, in _run_file(file, globals()) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/_python_runtime.py", line 193, in _run_file execfile(script_path, globals_) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 175, in main() File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 153, in main sandbox.enable_sandbox(config) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 159, in enable_sandbox import('%s.threading' % dist27.name) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 903, in load_module raise ImportError('No module named %s' % fullname) ImportError: No module named google.appengine.dist27.threading

2
It might help people to have a little context surrounding this question. Adding things like, did it ever work and what changed when it stopped working, would be helpful. - RacerNerd
Everything is working fine and I don't think I made any changes before this happens. The only thing that I can think of is that I install bigquery command line tool before this happens. But I don't think this should be the reason of this. - Frank Zhang
It doesn't sound like that is your issue. I wish I had more to offer. Good luck. - RacerNerd
For anyone else, try running with the flag --allow_skipped_files 1 - Dylan Madisetti

2 Answers

3
votes

The most probable reason is having another python package that is coming from google. Run python in verbose mode with python -vvvvv and try following command import google.

If the above import is successful make sure its coming from /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google which is the path of python google appengine libraries on my system (OSX, fresh install of google appengine sdk).

If that is not the case (but the import is successful) then its most likely other existing google libraries which are creating issue and the path of the same would be visible on python prompt after the successful import google command like following:

>>> import google

import google # loaded from Zip /Library/Python/2.7/site-packages/protobuf-2.4.1-py2.7.egg/google/init.pyc

In this case my google protobuf package was the culprit.

Solution:

  1. Use virtualenv: If you haven't used python virtualenv before, may be this is the best time to use it. (a) Make sure that your PYTHONPATH variable is not set to include anything that has a google package! Unset it running unset PYTHONPATH (in your bash prompt) unless you are very sure what you have there. (b) Create a new python virtualenv, activate it and try to run google appengine commands in it:

    virtualenv --no-site-packages /tmp/googleapps
    source /tmp/googleapps/bin/activate
    dev_appserver.py path_to_google_app
    
  2. Remove conflicting packages from path: Move conflicting packages a new virtualenv. This is likely to break other stuff so not recommended.

I had hit the same issue today. This being the top result on google but lacked any answers, I add this after fixing same issue on my system. There may be other possible reasons which thankfully I haven't come across.

Good luck!

1
votes

A recent upgrade of the development SDK started causing this problem for me. After much turmoil, I found that the problem was that the SDK was in a sub-directory of my project code. When I ran the SDK from a different (parent) directory the error went away.