Google App Engine SDK / Go (Linux version) and Python installed by linuxbrew are incompatible

I wrote this article while participating in GAE (Go / Python) Mokumoku Study Group in Yokohama Tanemaki vol.16 --connpass.

If you run goapp test or goapp serve with linuxbrew Python installed, you will get the following error:

2015/04/18 16:18:46 appengine: not running under devappserver2; using some default configuration
INFO     2015-04-18 07:18:47,665 devappserver2.py:726] Skipping SDK update check.
WARNING  2015-04-18 07:18:47,665 devappserver2.py:742] DEFAULT_VERSION_HOSTNAME will not be set correctly with --port=0
WARNING  2015-04-18 07:18:47,867 simple_search_stub.py:1126] Could not read search indexes from /tmp/appengine.testapp.xxxx/search_indexes
INFO     2015-04-18 07:18:47,869 api_server.py:172] Starting API server at: http://localhost:43830
INFO     2016-04-18 07:18:47,869 api_server.py:588] Applying all pending transactions and saving the datastore
INFO     2015-04-18 07:18:47,870 api_server.py:591] Saving search indexes
Traceback (most recent call last):
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in <module>
    _run_file(__file__, globals())
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 79, in _run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 985, in <module>
    main()
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 978, in main
    dev_server.start(options)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 774, in start
    self._dispatcher.start(options.api_host, apis.port, request_data)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 182, in start
    _module, port = self._create_module(module_configuration, port)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 262, in _create_module
    threadsafe_override=threadsafe_override)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1102, in __init__
    super(AutoScalingModule, self).__init__(**kwargs)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 519, in __init__
    self._use_mtime_file_watcher)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/file_watcher.py", line 145, in get_file_watcher
    return _create_linux_watcher(directories)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/file_watcher.py", line 120, in _create_linux_watcher
    inotify_file_watcher.InotifyFileWatcher)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/file_watcher.py", line 92, in _create_watcher
    return watcher_class(directories)
  File "/home/xxxx/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/inotify_file_watcher.py", line 139, in __init__
    self._inotify_poll = select.poll()
AttributeError: 'module' object has no attribute 'poll'

If you delete Python of linuxbrew with brew uninstall python and use standard Python, it will work.

What is select.poll ()? When I looked it up, the Python 2.7 documentation said:

(Not supported on all operating systems)Returns a polling object. This object can register and unregister file descriptors, and I for file descriptors/O You can poll for event occurrences;See the Polling Objects section for the methods provided by the polling objects.

http://docs.python.jp/2/library/select.html

For some reason, linuxbrew's Python seems to compile without this function ...

Recommended Posts

Google App Engine SDK / Go (Linux version) and Python installed by linuxbrew are incompatible
Runtime version of Google App Engine / Python Standard Environment
Deploy a Python app on Google App Engine and integrate it with GitHub
[Python] Run Flask on Google App Engine
About the problem that the python version of Google App Engine does not mesh
Tweet (API 1.1) on Google App Engine for Python
Google App Engine Datastore and Search API integration
Various memorandums when using sdk of LINE Messaging API with Python (2.7.9) + Google App Engine
[Python] Easy Google Translate app using Eel and Googletrans
Deploy a Django application on Google App Engine (Python3)
Google App Engine / Python development environment construction procedure (late 2014)
PIL with Python on Windows 8 (for Google App Engine)
Getting Started with Google App Engine for Python & PHP
How to use Django on Google App Engine / Python