Hydra install on python 3.10 fails due to VS build tools
Asked Answered
S

1

12

I'm trying to install Hydra 2.5 on a Windows 10 system. I have Visual Studio Build Tools 2022 installed with the desktop C++ development option. When I use pip I get the error attached below. I've tried it with both python 3.10 and 3.9. I've tried a fresh conda environment. I've also tried to install Mingw-w64 to see if that might help but it didn't help. Any suggestions would be appreciated.

Building wheels for collected packages: hfcnn, hydra
  Building wheel for hfcnn (setup.py) ... done
  Created wheel for hfcnn: filename=hfcnn-0.1.0-py2.py3-none-any.whl size=42563 sha256=6eddd284ff183a321cd329928f9d3c242253072b854502a6df97de9b413edc69
  Stored in directory: C:\Users\natep\AppData\Local\Temp\pip-ephem-wheel-cache-w1fs1loj\wheels\24\17\50\c13d5e23193f95d3a4a29906052d1bfec09abb75cf58968c32
  Building wheel for hydra (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [39 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      copying src\hydra.py -> build\lib.win-amd64-3.10
      running build_ext
      building '_hydra' extension
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\src
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\natep\AppData\Local\Temp\pip-install-k0ndin1s\hydra_a0d7e613ec4f4a2091c58d266385d27f\src -IC:\Users\natep\anaconda3\envs\hfcnn\include -IC:\Users\natep\anaconda3\envs\hfcnn\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcsrc/MurmurHash3.c /Fobuild\temp.win-amd64-3.10\Release\src/MurmurHash3.obj -std=gnu99 -O2 -D_LARGEFILE64_SOURCE
      cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
      MurmurHash3.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\natep\AppData\Local\Temp\pip-install-k0ndin1s\hydra_a0d7e613ec4f4a2091c58d266385d27f\src -IC:\Users\natep\anaconda3\envs\hfcnn\include -IC:\Users\natep\anaconda3\envs\hfcnn\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcsrc/_hydra.c /Fobuild\temp.win-amd64-3.10\Release\src/_hydra.obj -std=gnu99 -O2 -D_LARGEFILE64_SOURCE
      cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
      _hydra.c
      src/_hydra.c(1621): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      src/_hydra.c(2668): warning C4267: '=': conversion from 'size_t' to 'char', possible loss of data
      src/_hydra.c(3377): warning C4018: '<': signed/unsigned mismatch
      src/_hydra.c(6964): warning C4244: 'function': conversion from 'unsigned __int64' to 'unsigned long', possible loss of data
      src/_hydra.c(7072): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      src/_hydra.c(7103): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      src/_hydra.c(7316): warning C4267: 'function': conversion from 'size_t' to 'unsigned int', possible loss of data
      src/_hydra.c(7445): error C2105: '++' needs l-value
      src/_hydra.c(7447): error C2105: '--' needs l-value
      src/_hydra.c(8530): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(8535): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(8539): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(8551): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(9924): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      src/_hydra.c(9940): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      src/_hydra.c(11521): warning C4996: 'PyCFunction_Call': deprecated in 3.9
      src/_hydra.c(11586): warning C4996: 'PyCFunction_Call': deprecated in 3.9
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for hydra
  Running setup.py clean for hydra
Successfully built hfcnn
Failed to build hydra
Installing collected packages: hydra, funcy, dictdiffer, commonmark, billiard, appdirs, zipp, zc.lockfile, xmltodict, websocket-client, waitress, vine, urllib3, typing-extensions, torchinfo, tomlkit, toml, tensorboard-data-server, tabulate, sqlparse, sniffio, smmap, six, shtab, shortuuid, ruamel.yaml.clib, rsa, pyyaml, python-slugify, pypiwin32, pyparsing, pyjwt, pygments, pycparser, pyasn1-modules, psutil, protobuf, prompt-toolkit, prometheus-client, pillow, pathspec, oauthlib, numpy, networkx, multidict, MarkupSafe, markdown, kiwisolver, itsdangerous, idna, h11, greenlet, future, ftfy, fsspec, frozenlist, fonttools, entrypoints, dvc-render, dpath, distro, diskcache, dill, cycler, colorama, cloudpickle, charset-normalizer, cachetools, attrs, atpublic, async-timeout, absl-py, yarl, werkzeug, tqdm, torch, sqlalchemy, scipy, ruamel.yaml, rich, requests, querystring-parser, python-dateutil, pydot, packaging, Mako, Jinja2, importlib-metadata, grpcio, grandalf, google-auth, gitdb, flufl.lock, flatten-dict, dulwich, configobj, click, cffi, anyio, amqp, aiosignal, torchvision, requests-oauthlib, python-benedict, pygit2, pandas, matplotlib, kombu, hyperopt, httpcore, gitpython, Flask, dvclive, dvc-objects, docker, databricks-cli, cryptography, click-repl, click-plugins, click-didyoumean, alembic, aiohttp, rna, prometheus-flask-exporter, pandarallel, httpx, google-auth-oauthlib, dvc-data, celery, asyncssh, aiohttp-retry, webdav4, tensorboard, scmrepo, mlflow, dvc-task, dvc, hfcnn
  Running setup.py install for hydra ... error
  error: subprocess-exited-with-error

  × Running setup.py install for hydra did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]
      running install
      C:\Users\natep\anaconda3\envs\hfcnn\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      copying src\hydra.py -> build\lib.win-amd64-3.10
      running build_ext
      building '_hydra' extension
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\src
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\natep\AppData\Local\Temp\pip-install-k0ndin1s\hydra_a0d7e613ec4f4a2091c58d266385d27f\src -IC:\Users\natep\anaconda3\envs\hfcnn\include -IC:\Users\natep\anaconda3\envs\hfcnn\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcsrc/MurmurHash3.c /Fobuild\temp.win-amd64-3.10\Release\src/MurmurHash3.obj -std=gnu99 -O2 -D_LARGEFILE64_SOURCE
      cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
      MurmurHash3.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\natep\AppData\Local\Temp\pip-install-k0ndin1s\hydra_a0d7e613ec4f4a2091c58d266385d27f\src -IC:\Users\natep\anaconda3\envs\hfcnn\include -IC:\Users\natep\anaconda3\envs\hfcnn\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcsrc/_hydra.c /Fobuild\temp.win-amd64-3.10\Release\src/_hydra.obj -std=gnu99 -O2 -D_LARGEFILE64_SOURCE
      cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
      _hydra.c
      src/_hydra.c(1621): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      src/_hydra.c(2668): warning C4267: '=': conversion from 'size_t' to 'char', possible loss of data
      src/_hydra.c(3377): warning C4018: '<': signed/unsigned mismatch
      src/_hydra.c(6964): warning C4244: 'function': conversion from 'unsigned __int64' to 'unsigned long', possible loss of data
      src/_hydra.c(7072): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      src/_hydra.c(7103): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      src/_hydra.c(7316): warning C4267: 'function': conversion from 'size_t' to 'unsigned int', possible loss of data
      src/_hydra.c(7445): error C2105: '++' needs l-value
      src/_hydra.c(7447): error C2105: '--' needs l-value
      src/_hydra.c(8530): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(8535): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(8539): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(8551): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Users\natep\anaconda3\envs\hfcnn\include\cpython/object.h(191): note: see declaration of '_typeobject'
      src/_hydra.c(9924): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      src/_hydra.c(9940): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      src/_hydra.c(11521): warning C4996: 'PyCFunction_Call': deprecated in 3.9
      src/_hydra.c(11586): warning C4996: 'PyCFunction_Call': deprecated in 3.9
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> hydra

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Salazar answered 7/8, 2022 at 21:6 Comment(0)
B
34

The package name is hydra-core :).

Berthoud answered 8/8, 2022 at 3:4 Comment(5)
Slams head into wall Spends hours trying to identify the issue with the package... It's the wrong package. lol Thanks for pointing out my stupidity.Salazar
Common mistake. I did reach out to the owner of the hydra package before releasing Hydra asking if he can let go of the package name but as expected he didn't feel like it. Can't say I blame him, but it's his fault ;).Berthoud
exactly what I needed... these are the most important SO questionsAmieva
A lot of people have wrongly downloaded and executed the hydra package on their machine when they meant to install hydra-core. I wonder, has anyone done an open source review of hydra? Just to make sure we're all good, executing arbitrary C++ code potentially in the worst case after all yeah?Amadus
I did not do a real review it, but it predated Hydra Framework, and it looks like a legit unmaintained project. github.com/crankycoder/hydraBerthoud

© 2022 - 2024 — McMap. All rights reserved.