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