Python 3.6.4で、pip install python-memcached==1.58 したところ「tuple index out of range」エラー


# 仮想環境を作る
$ python -m venv env364

# アクティベート
$ source env364/bin/activate

# Pythonのバージョンを確認
(env364) $ python --version
Python 3.6.4

# pipでインストール
(env364) $ pip install python-memcached==1.58
Collecting python-memcached==1.58
  Using cached
    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/h0/l5plp4zd3517r988jpm481g00000gn/T/pip-build-q026ekfn/python-memcached/", line 8, in <module>
        version=get_module_constant('memcache', '__version__'),
      File "/path/to/lib/python3.6/site-packages/setuptools/", line 164, in get_module_constant
        return extract_constant(code, symbol, default)
      File "/path/to/lib/python3.6/site-packages/setuptools/", line 195, in extract_constant
        const = code.co_consts[arg]
    IndexError: tuple index out of range




  • Python 3.6.4
  • setuptools 28.8.0



can't install python-memcached1.58 in Python 3.6.0b2 · Issue #103 · linsomniac/python-memcached



# setuptoolsのバージョンを上げる
(env364) $ pip install -U setuptools
Collecting setuptools
  Using cached
Installing collected packages: setuptools
  Found existing installation: setuptools 28.8.0
    Uninstalling setuptools-28.8.0:
      Successfully uninstalled setuptools-28.8.0
Successfully installed setuptools-40.6.3

# python-memcachedをインストール
(env364) $ pip install python-memcached==1.58
Collecting python-memcached==1.58
  Using cached
Requirement already satisfied: six>=1.4.0 in ./env364/lib/python3.6/site-packages (from python-memcached==1.58)
Installing collected packages: python-memcached
  Running install for python-memcached ... done
Successfully installed python-memcached-1.58

ちなみに、python-memcached 1.59 ではエラーが発生せずにインストールできるようです。

# 仮想環境を作る
$ python -m venv env364_1

# アクティベート
$ source env364_1/bin/activate

# setuptoolsのバージョンを確認
(env364_1) $ pip list
pip (9.0.1)
setuptools (28.8.0)

# インストール
(env364_1) $ pip install python-memcached
Collecting python-memcached
  Using cached
Collecting six>=1.4.0 (from python-memcached)
  Using cached
Installing collected packages: six, python-memcached
Successfully installed python-memcached-1.59 six-1.12.0