之前在安装hydra的时候一直安装不上去,按照网上的建议要先安装一个VC++的编译环境,我把这个装上去之后还是一直报错:
ERROR: Command errored out with exit status 1: ‘d:\anaconda\envs\torch371\python.exe’ -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\lenovo\AppData\Local\Temp\pip-install-k6o3k4on\hydra_2deec89ac4
18489ab4a852adccc45490\setup.py’"’"’; file=’"’"‘C:\Users\lenovo\AppData\Local\Temp\pip-install-k6o3k4on\hydra_2deec89ac418489ab4a852adccc45490\setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.pat
h.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 ‘C:\Users\lenovo\App
Data\Local\Temp\pip-record-vkiywefd\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘d:\anaconda\envs\torch371\Include\hydra’ Check the logs for full command output.
搜索了很久没有解决
后来我发现安装这个库只需要输入这个命令就可以了
pip install hydra-core --upgrade
这个是它的官网
https://pypi.org/project/hydra-core/
安装之后就能在pycharm里面导入了
ModuleNotFoundError: No module named ‘hydra‘
最新推荐文章于 2025-03-25 10:09:19 发布