Help us understand the problem. What is going on with this article?

Google App Engine SDK/Go(Linux版)とlinuxbrewでインストールしたPythonの相性が悪い件

More than 3 years have passed since last update.

この記事は、GAE (Go/Python) もくもく勉強会 in 横浜タネマキ vol.16 - connpass参加中に書きました。

linuxbrewのPythonが入っている状態で goapp testgoapp serve を実行すると、以下のようなエラーが出ます。

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'

brew uninstall pythonでlinuxbrewのPythonを消して標準のPythonを使うようにすれば動くようになります。

select.poll()って何だろ? と思って調べてみたら、Python2.7のドキュメントにこう書いてありました。

(全てのオペレーティングシステムでサポートされているわけではありません) ポーリングオブジェクトを返します。このオブジェクトはファイル記述子を登録したり登録解除したりすることができ、ファイル記述子に対する I/O イベント発生をポーリングすることができます; ポーリングオブジェクトが提供しているメソッドについては ポーリングオブジェクト 節を参照してください。

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

なぜか、linuxbrewのPythonはこの関数がない状態でコンパイルされるようですね…

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away