LoginSignup
0
1

More than 3 years have passed since last update.

【tf-pose-estimation】requirements.txtのpip3 install ができない

Posted at

s3.png

概要

骨格推定のライブラリで有名な「tf-pose-estimation」を利用する際にrequirements.txtに書かれているモジュールをインストールする際にかなり詰まったのでメモ。

事象

https://qiita.com/ikekou/items/9a632b10588b423db172
上記の手順のなかで「pip3 install -r requirements.txt」
でエラーになる。

エラーログ

・・・省略・・・
Collecting pycocotools
  Downloading https://files.pythonhosted.org/packages/96/84/9a07b1095fd8555ba3f3d519517c8743c2554a245f9476e5e39869f948d2/pycocotools-2.0.0.tar.gz (1.5MB)
     |████████████████████████████████| 1.5MB 2.5MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9r/s1rktt555mdgy44wfqx5kg780000gp/T/pip-install-x_yvzfkm/pycocotools/setup.py'"'"'; __file__='"'"'/private/var/folders/9r/s1rktt555mdgy44wfqx5kg780000gp/T/pip-install-x_yvzfkm/pycocotools/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/9r/s1rktt555mdgy44wfqx5kg780000gp/T/pip-install-x_yvzfkm/pycocotools/pip-egg-info
         cwd: /private/var/folders/9r/s1rktt555mdgy44wfqx5kg780000gp/T/pip-install-x_yvzfkm/pycocotools/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/9r/s1rktt555mdgy44wfqx5kg780000gp/T/pip-install-x_yvzfkm/pycocotools/setup.py", line 2, in <module>
        from Cython.Build import cythonize
    ModuleNotFoundError: No module named 'Cython'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ログ的には「Cythonのモジュールがないかからインストールしてね」っていってるんだけど、他にも色々と対応が必要だった。

解消方法

Cythonのインストールも合わせて以下の手順を実施したところ解消した。

$ brew install pyenv
$ pyenv install 3.6.5
$ pyenv global 3.6.5  
$ eval "$(pyenv init -)"
$ pip install --upgrade pip
$ pip install --upgrade cython
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1