onnx / keras-onnx

Convert tf.keras/Keras models to ONNX
Apache License 2.0
379 stars 110 forks source link

AssertionError: Could not find "cmake" executable! in python 3.9.2 #701

Closed hanzigs closed 3 years ago

hanzigs commented 3 years ago

Tried to install

pip install keras2onnx==1.7.0

in python 3.9.2 windows 10 getting error

Collecting keras2onnx==1.7.0
  Using cached keras2onnx-1.7.0-py3-none-any.whl (96 kB)
Collecting onnx
  Downloading onnx-1.8.1.tar.gz (5.2 MB)
     |████████████████████████████████| 5.2 MB ...
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\PG\Anaconda3\envs\automl3927120\python.exe' 'C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\PREMGE~1\AppData\Local\Temp\tmpltu4c6pa'
       cwd: C:\Users\PG\AppData\Local\Temp\pip-install-mbft553m\onnx_5ada69c955b94789936a899f4eabb02f
  Complete output (19 lines):
  fatal: not a git repository (or any of the parent directories): .git
  Traceback (most recent call last):
    File "C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
      main()
    File "C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-kbwhpegm\overlay\Lib\site-packages\setuptools\build_meta.py", line 154, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-kbwhpegm\overlay\Lib\site-packages\setuptools\build_meta.py", line 135, in _get_build_requires
      self.run_setup()
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-kbwhpegm\overlay\Lib\site-packages\setuptools\build_meta.py", line 258, in run_setup
      super(_BuildMetaLegacyBackend,
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-kbwhpegm\overlay\Lib\site-packages\setuptools\build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 75, in <module>
      assert CMAKE, 'Could not find "cmake" executable!'
  AssertionError: Could not find "cmake" executable!
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2b/8d/c924f54e19ec71543c18658d86e8337579d5a784bd524b7f18e2e2cd6f17/onnx-1.8.1.tar.gz#sha256=9d65c52009a90499f8c25fdfe5acda3ac88efe0788eb1d5f2575a989277145fb (from https://pypi.org/simple/onnx/). Command errored out with exit status 1: 'C:\Users\PG\Anaconda3\envs\automl3927120\python.exe' 'C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\PREMGE~1\AppData\Local\Temp\tmpltu4c6pa' Check the logs for full command output.
  Downloading onnx-1.8.0.tar.gz (5.2 MB)
     |████████████████████████████████| 5.2 MB 6.4 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\PG\Anaconda3\envs\automl3927120\python.exe' 'C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\PG~1\AppData\Local\Temp\tmpblt6316e'
       cwd: C:\Users\PG\AppData\Local\Temp\pip-install-mbft553m\onnx_b76bdbcddcab4b36bb3832297d250269
  Complete output (19 lines):
  fatal: not a git repository (or any of the parent directories): .git
  Traceback (most recent call last):
    File "C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
      main()
    File "C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-hapy4ibt\overlay\Lib\site-packages\setuptools\build_meta.py", line 154, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-hapy4ibt\overlay\Lib\site-packages\setuptools\build_meta.py", line 135, in _get_build_requires
      self.run_setup()
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-hapy4ibt\overlay\Lib\site-packages\setuptools\build_meta.py", line 258, in run_setup
      super(_BuildMetaLegacyBackend,
    File "C:\Users\PG\AppData\Local\Temp\pip-build-env-hapy4ibt\overlay\Lib\site-packages\setuptools\build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 75, in <module>
      assert CMAKE, 'Could not find "cmake" executable!'
  AssertionError: Could not find "cmake" executable!
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bc/8b/a7de205514540e99d3e00b35b01710345b1306a2a04d75ef6697f074f499/onnx-1.8.0.tar.gz#sha256=5f787fd3ce1290e12da335237b3b921152157e51aa09080b65631b3ce3fcc50c (from https://pypi.org/simple/onnx/). Command errored out with exit status 1: 'C:\Users\PG\Anaconda3\envs\automl3927120\python.exe' 'C:\Users\PG\Anaconda3\envs\automl3927120\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\PG~1\AppData\Local\Temp\tmpblt6316e' Check the logs for full command output.
  Downloading onnx-1.7.0.tar.gz (5.5 MB)
     |████████████████████████████████| 5.5 MB ...
ERROR: Could not install packages due to an OSError: [WinError 206] The filename or extension is too long: 'C:\\Users\\PG\\AppData\\Local\\Temp\\pip-install-mbft553m\\onnx_e2cb0332cc6e4e4a943722e10e194a6a\\onnx/backend/test/data/node/test_negative_log_likelihood_loss_input_shape_is_NCd1d2d3_none_no_weight_negative_ignore_index_expanded/test_data_set_0/'
jiafatom commented 3 years ago

If you only install onnx==1.8.1, can it work?

hanzigs commented 3 years ago

Sorry for late update, pip install keras2onnx and onnxruntime worked in python 3.9.5