0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pip install hydra してはいけない

Posted at

TL;DR

機械学習の hydra パッケージは pip install hydra では入らない。pip install hydra-core しないといけない。

どういうことか

機械学習の hydra は便利なパラメータ管理のためのパッケージだが、同名の先発のパッケージがある。なので、PyPy上では hydra は別のパッケージで、機械学習のほうのhydra は hydra-core というパッケージ名になっている。使う時は import hydra なので、よく忘れる。

先発の Hydra はPythonの新しめのバージョンをサポートしていないので、普通に pip install hydra すると Cのエラーが出る。困ったことに、何かおかしいな、と思ってエラーメッセージを検索しても根本的な解決には辿りつかない。具体的には次のようなエラーが出る。

ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9y/0v69xg7d5r941xdqgbl_7bqw0000gn/T/pip-install-8ecvx8rx/hydra_75c536766069419a959274801836af60/setup.py'"'"'; __file__='"'"'/private/var/folders/9y/0v69xg7d5r941xdqgbl_7bqw0000gn/T/pip-install-8ecvx8rx/hydra_75c536766069419a959274801836af60/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/9y/0v69xg7d5r941xdqgbl_7bqw0000gn/T/pip-record-8ksuyn9s/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/[ユーザ名]/Library/Python/3.9/include/python3.9/hydra Check the logs for full command output.

とか、

fatal error: longintrepr.h: No such file or directory
        198 |   #include "longintrepr.h"
hydra error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

とかである。エラーメッセージを検索してこの記事がヒットすることを願う。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?