question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install from pip fails due to spaces in path

See original GitHub issue

Bug Report

Describe the bug

I’m trying t run pip install onnx and I get the following error

      [  9%] Built target onnxifi_wrapper
      /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/tools/protoc-gen-mypy.sh: line 4: /Volumes/Sabrent: No such file or directory
      --mypy_out: protoc-gen-mypy: Plugin failed with status code 127.
      gmake[2]: *** [CMakeFiles/gen_onnx_proto.dir/build.make:74: onnx/onnx-ml.pb.cc] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/gen_onnx_proto.dir/all] Error 2
      gmake: *** [Makefile:136: all] Error 2

The full path to my python venv is
/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/

The full error message is…

Collecting onnx
  Using cached onnx-1.12.0.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.16.6 in ./lib/python3.10/site-packages (from onnx) (1.23.1)
Requirement already satisfied: protobuf<=3.20.1,>=3.12.2 in ./lib/python3.10/site-packages (from onnx) (3.19.4)
Requirement already satisfied: typing-extensions>=3.6.2.1 in ./lib/python3.10/site-packages (from onnx) (4.3.0)
Building wheels for collected packages: onnx
  Building wheel for onnx (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [124 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      running bdist_wheel
      running build
      running build_py
      running create_version
      running cmake_build
      Using cmake args: ['/opt/local/bin/cmake', '-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10', '-DPYTHON_EXECUTABLE=/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-darwin.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb']
      -- The C compiler identification is AppleClang 13.1.6.13160021
      -- The CXX compiler identification is AppleClang 13.1.6.13160021
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found PythonInterp: /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/python (found version "3.10.4")
      -- Found PythonLibs: /opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib (found version "3.10.4")
      -- Found Protobuf: /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/libprotobuf.dylib (found version "3.21.5")
      Generated: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-ml.proto
      Generated: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
      Generated: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-data.proto
      -- Could NOT find pybind11 (missing: pybind11_DIR)
      -- pybind11 v2.9.1
      -- Found PythonLibs: /opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Performing Test HAS_FLTO_THIN
      -- Performing Test HAS_FLTO_THIN - Success
      --
      -- ******** Summary ********
      --   CMake version             : 3.22.4
      --   CMake command             : /opt/local/bin/cmake
      --   System                    : Darwin
      --   C++ compiler              : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
      --   C++ compiler version      : 13.1.6.13160021
      --   CXX flags                 :  -Wnon-virtual-dtor
      --   Build type                : Release
      --   Compile definitions       : __STDC_FORMAT_MACROS
      --   CMAKE_PREFIX_PATH         :
      --   CMAKE_INSTALL_PREFIX      : /usr/local
      --   CMAKE_MODULE_PATH         :
      --
      --   ONNX version              : 1.12.0
      --   ONNX NAMESPACE            : onnx
      --   ONNX_USE_LITE_PROTO       : OFF
      --   USE_PROTOBUF_SHARED_LIBS  : OFF
      --   Protobuf_USE_STATIC_LIBS  : ON
      --   ONNX_DISABLE_EXCEPTIONS   : OFF
      --   ONNX_WERROR               : OFF
      --   ONNX_BUILD_TESTS          : OFF
      --   ONNX_BUILD_BENCHMARKS     : OFF
      --   ONNXIFI_DUMMY_BACKEND     : OFF
      --   ONNXIFI_ENABLE_EXT        : OFF
      --
      --   Protobuf compiler         : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/protoc
      --   Protobuf includes         : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/include
      --   Protobuf libraries        : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/libprotobuf.dylib
      --   BUILD_ONNX_PYTHON         : ON
      --     Python version        :
      --     Python executable     : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/python
      --     Python includes       : /opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build
      [  4%] Building C object CMakeFiles/onnxifi_dummy.dir/onnx/onnxifi_dummy.c.o
      [  4%] Building C object CMakeFiles/onnxifi_loader.dir/onnx/onnxifi_loader.c.o
      [  4%] Running gen_proto.py on onnx/onnx.in.proto
      Processing /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/onnx/onnx.in.proto
      Writing /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-ml.proto
      Writing /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-ml.proto3
      generating /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx_pb.py
      [  5%] Running C++ protocol buffer compiler on /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-ml.proto
      [  7%] Linking C static library libonnxifi_loader.a
      [  8%] Linking C shared library libonnxifi_dummy.dylib
      [  8%] Built target onnxifi_loader
      [  8%] Built target onnxifi_dummy
      [  9%] Building C object CMakeFiles/onnxifi_wrapper.dir/onnx/onnxifi_wrapper.c.o
      [ 11%] Linking C shared module libonnxifi.dylib
      [ 11%] Built target onnxifi_wrapper
      /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/tools/protoc-gen-mypy.sh: line 4: /Volumes/Sabrent: No such file or directory
      --mypy_out: protoc-gen-mypy: Plugin failed with status code 127.
      gmake[2]: *** [CMakeFiles/gen_onnx_proto.dir/build.make:74: onnx/onnx-ml.pb.cc] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/gen_onnx_proto.dir/all] Error 2
      gmake: *** [Makefile:136: all] Error 2
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/setup.py", line 332, in <module>
          setuptools.setup(
        File "/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/setup.py", line 223, in run
          self.run_command("cmake_build")
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/setup.py", line 217, in run
          subprocess.check_call(build_args)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/local/bin/cmake', '--build', '.', '--', '-j', '8']' returned non-zero exit status 2.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onnx
  Running setup.py clean for onnx
Failed to build onnx
Installing collected packages: onnx
  Running setup.py install for onnx ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for onnx did not run successfully.
  │ exit code: 1
  ╰─> [98 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      running install
      running build
      running build_py
      running create_version
      running cmake_build
      Using cmake args: ['/opt/local/bin/cmake', '-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10', '-DPYTHON_EXECUTABLE=/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-darwin.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb']
      Generated: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-ml.proto
      Generated: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
      Generated: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-data.proto
      -- Could NOT find pybind11 (missing: pybind11_DIR)
      -- pybind11 v2.9.1
      --
      -- ******** Summary ********
      --   CMake version             : 3.22.4
      --   CMake command             : /opt/local/bin/cmake
      --   System                    : Darwin
      --   C++ compiler              : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
      --   C++ compiler version      : 13.1.6.13160021
      --   CXX flags                 :  -Wnon-virtual-dtor
      --   Build type                : Release
      --   Compile definitions       : __STDC_FORMAT_MACROS
      --   CMAKE_PREFIX_PATH         :
      --   CMAKE_INSTALL_PREFIX      : /usr/local
      --   CMAKE_MODULE_PATH         :
      --
      --   ONNX version              : 1.12.0
      --   ONNX NAMESPACE            : onnx
      --   ONNX_USE_LITE_PROTO       : OFF
      --   USE_PROTOBUF_SHARED_LIBS  : OFF
      --   Protobuf_USE_STATIC_LIBS  : ON
      --   ONNX_DISABLE_EXCEPTIONS   : OFF
      --   ONNX_WERROR               : OFF
      --   ONNX_BUILD_TESTS          : OFF
      --   ONNX_BUILD_BENCHMARKS     : OFF
      --   ONNXIFI_DUMMY_BACKEND     : OFF
      --   ONNXIFI_ENABLE_EXT        : OFF
      --
      --   Protobuf compiler         : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/protoc
      --   Protobuf includes         : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/include
      --   Protobuf libraries        : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/libprotobuf.dylib
      --   BUILD_ONNX_PYTHON         : ON
      --     Python version        :
      --     Python executable     : /Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/bin/python
      --     Python includes       : /opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build
      Consolidate compiler generated dependencies of target onnxifi_dummy
      Consolidate compiler generated dependencies of target onnxifi_loader
      [  1%] Running C++ protocol buffer compiler on /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/onnx/onnx-ml.proto
      [  7%] Built target onnxifi_dummy
      [  7%] Built target onnxifi_loader
      Consolidate compiler generated dependencies of target onnxifi_wrapper
      [  9%] Built target onnxifi_wrapper
      /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/.setuptools-cmake-build/tools/protoc-gen-mypy.sh: line 4: /Volumes/Sabrent: No such file or directory
      --mypy_out: protoc-gen-mypy: Plugin failed with status code 127.
      gmake[2]: *** [CMakeFiles/gen_onnx_proto.dir/build.make:74: onnx/onnx-ml.pb.cc] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/gen_onnx_proto.dir/all] Error 2
      gmake: *** [Makefile:136: all] Error 2
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/setup.py", line 332, in <module>
          setuptools.setup(
        File "/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/Volumes/Sabrent Media/Documents/Source/Python/pytorch_env/lib/python3.10/site-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/install.py", line 568, in run
          self.run_command('build')
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/setup.py", line 223, in run
          self.run_command("cmake_build")
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-install-19y8i46a/onnx_08b9cb443db945b9b10e5844dcd22bbb/setup.py", line 217, in run
          subprocess.check_call(build_args)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/local/bin/cmake', '--build', '.', '--', '-j', '8']' returned non-zero exit status 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.
╰─> onnx

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

System information

  • MacOS 12.5
  • ONNX version 1.12.0
  • Python version: 3.10
  • GCC/Compiler version (if compiling from source): Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  • CMake version: cmake version 3.22.4
  • Protobuf version: libprotoc 3.21.5

Reproduction instructions

Not sure, put I suspect creating a venv on a path with space on it, manually compiling protobuf-cpp so it installs in the venv path and then doing a pip install onnx

Expected behavior

onnx to compile successfully

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Vargolcommented, Aug 28, 2022

@jcwchen

It kind of worked, I had to use SETUPTOOLS_ENABLE_FEATURES="legacy-editable" to get a successful install, maybe I’ve got something out of date in my venv, I know my pip is out of date.

Without the legacy-editable It failed with

 onnx % pip install -e .               
Obtaining file:///Volumes/Sabrent%20Media/Documents/Source/Python/diffuse/onnx
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting protobuf<=3.20.1,>=3.12.2
  Using cached protobuf-3.20.1-cp310-cp310-macosx_10_9_universal2.whl (962 kB)
Requirement already satisfied: numpy>=1.16.6 in /Volumes/Sabrent Media/Documents/Source/Python/diffuse/lib/python3.10/site-packages (from onnx==1.12.0) (1.23.2)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /Volumes/Sabrent Media/Documents/Source/Python/diffuse/lib/python3.10/site-packages (from onnx==1.12.0) (4.3.0)
Building wheels for collected packages: onnx
  Building editable for onnx (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building editable for onnx (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [123 lines of output]
      running editable_wheel
      creating /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info
      writing /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/PKG-INFO
      writing dependency_links to /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/dependency_links.txt
      writing entry points to /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/entry_points.txt
      writing requirements to /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/requires.txt
      writing top-level names to /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/top_level.txt
      writing manifest file '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/SOURCES.txt'
      reading manifest file '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx.egg-info/SOURCES.txt'
      creating '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx-1.12.0.dist-info'
      adding license file "LICENSE" (matched pattern "LICENSE")
      creating /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-wheel-yapnkxew/tmp0o621mgu/onnx-1.12.0.dist-info/WHEEL
      /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/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_py
      running create_version
      running cmake_build
      Using cmake args: ['/opt/local/bin/cmake', '-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10', '-DPYTHON_EXECUTABLE=/Volumes/Sabrent Media/Documents/Source/Python/diffuse/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-darwin.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/Volumes/Sabrent Media/Documents/Source/Python/diffuse/onnx']
      Generated: /Volumes/Sabrent Media/Documents/Source/Python/diffuse/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
      Generated: /Volumes/Sabrent Media/Documents/Source/Python/diffuse/onnx/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
      Generated: /Volumes/Sabrent Media/Documents/Source/Python/diffuse/onnx/.setuptools-cmake-build/onnx/onnx-data.proto
      -- Could NOT find pybind11 (missing: pybind11_DIR)
      -- pybind11 v2.9.1
      --
      -- ******** Summary ********
      --   CMake version             : 3.22.4
      --   CMake command             : /opt/local/bin/cmake
      --   System                    : Darwin
      --   C++ compiler              : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
      --   C++ compiler version      : 13.1.6.13160021
      --   CXX flags                 :  -Wnon-virtual-dtor
      --   Build type                : Release
      --   Compile definitions       : __STDC_FORMAT_MACROS
      --   CMAKE_PREFIX_PATH         :
      --   CMAKE_INSTALL_PREFIX      : /usr/local
      --   CMAKE_MODULE_PATH         :
      --
      --   ONNX version              : 1.12.0
      --   ONNX NAMESPACE            : onnx
      --   ONNX_USE_LITE_PROTO       : OFF
      --   USE_PROTOBUF_SHARED_LIBS  : OFF
      --   Protobuf_USE_STATIC_LIBS  : ON
      --   ONNX_DISABLE_EXCEPTIONS   : OFF
      --   ONNX_WERROR               : OFF
      --   ONNX_BUILD_TESTS          : OFF
      --   ONNX_BUILD_BENCHMARKS     : OFF
      --   ONNXIFI_DUMMY_BACKEND     : OFF
      --   ONNXIFI_ENABLE_EXT        : OFF
      --
      --   Protobuf compiler         : /Volumes/Sabrent Media/Documents/Source/Python/diffuse/bin/protoc
      --   Protobuf includes         : /Volumes/Sabrent Media/Documents/Source/Python/diffuse/include
      --   Protobuf libraries        : /Volumes/Sabrent Media/Documents/Source/Python/diffuse/lib/libprotobuf.a
      --   BUILD_ONNX_PYTHON         : ON
      --     Python version        :
      --     Python executable     : /Volumes/Sabrent Media/Documents/Source/Python/diffuse/bin/python
      --     Python includes       : /opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /Volumes/Sabrent Media/Documents/Source/Python/diffuse/onnx/.setuptools-cmake-build
      Consolidate compiler generated dependencies of target onnxifi_dummy
      Consolidate compiler generated dependencies of target onnxifi_loader
      [  2%] Built target gen_onnx_proto
      [  8%] Built target onnxifi_loader
      [  8%] Built target onnxifi_dummy
      Consolidate compiler generated dependencies of target onnxifi_wrapper
      [ 13%] Built target gen_onnx_operators_proto
      [ 13%] Built target gen_onnx_data_proto
      [ 16%] Built target onnxifi_wrapper
      Consolidate compiler generated dependencies of target onnx_proto
      [ 30%] Built target onnx_proto
      Consolidate compiler generated dependencies of target onnx
      [ 97%] Built target onnx
      Consolidate compiler generated dependencies of target onnx_cpp2py_export
      [100%] Built target onnx_cpp2py_export
      running build_ext
      copying /Volumes/Sabrent Media/Documents/Source/Python/diffuse/onnx/.setuptools-cmake-build/onnx_cpp2py_export.cpython-310-darwin.so -> /private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/tmp8hcss9vq.build-lib/onnx
      Traceback (most recent call last):
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/file_util.py", line 40, in _copy_file_contents
          fdst = open(dst, 'wb')
      FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/tmp8hcss9vq.build-lib/onnx/onnx_cpp2py_export.cpython-310-darwin.so'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 140, in run
          self._create_wheel_file(bdist_wheel)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 330, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 261, in _run_build_commands
          self._run_build_subcommands()
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 288, in _run_build_subcommands
          self.run_command(name)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
          cmd_obj.run()
        File "<string>", line 255, in run
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "<string>", line 272, in build_extensions
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 351, in copy_file
          return file_util.copy_file(
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/file_util.py", line 163, in copy_file
          _copy_file_contents(src, dst)
        File "/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/pip-build-env-bn43vb9r/overlay/lib/python3.10/site-packages/setuptools/_distutils/file_util.py", line 42, in _copy_file_contents
          raise DistutilsFileError(
      distutils.errors.DistutilsFileError: could not create '/private/var/folders/mq/w85wcgsx58g9xjz_66mj8bk40000gn/T/tmp8hcss9vq.build-lib/onnx/onnx_cpp2py_export.cpython-310-darwin.so': No such file or directory
      error: Support for editable installs via PEP 660 was recently introduced
      in `setuptools`. If you are seeing this error, please report to:
      
      https://github.com/pypa/setuptools/issues
      
      Meanwhile you can try the legacy behavior by setting an
      environment variable and trying to install again:
      
      SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for onnx
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects
WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the '/Volumes/Sabrent Media/Documents/Source/Python/diffuse/bin/python -m pip install --upgrade pip' command.

After this failure, this worked…

onnx % export  SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
onnx % pip install -e .                                    
Obtaining file:///Volumes/Sabrent%20Media/Documents/Source/Python/diffuse/onnx
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting protobuf<=3.20.1,>=3.12.2
  Using cached protobuf-3.20.1-cp310-cp310-macosx_10_9_universal2.whl (962 kB)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /Volumes/Sabrent Media/Documents/Source/Python/diffuse/lib/python3.10/site-packages (from onnx==1.12.0) (4.3.0)
Requirement already satisfied: numpy>=1.16.6 in /Volumes/Sabrent Media/Documents/Source/Python/diffuse/lib/python3.10/site-packages (from onnx==1.12.0) (1.23.2)
Installing collected packages: protobuf, onnx
  Running setup.py develop for onnx
Successfully installed onnx-1.12.0 protobuf-3.20.1
WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the '/Volumes/Sabrent Media/Documents/Source/Python/diffuse/bin/python -m pip install --upgrade pip' command.

Then after that I pip uninstall onnx and deleted the old clone, and re-cloned with the PR and ran

onnx % export  SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
onnx % pip install -e .   

to get a clean run, which worked.

0reactions
jcwchencommented, Aug 26, 2022

I can repro this issue while installing ONNX with spaces in path on my Mac. Could you please try this PR: https://github.com/onnx/onnx/pull/4473 and see whether it solves this issue from your end? Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spaces in Python path make pip-installed launchers fail on ...
Launchers (console_scripts) installed via pip under Windows fail when Python is installed in a path that contains spaces (e.g. C:\Program Files (x86)\..., ...
Read more >
pip3 fails to install python module with space in name from ...
PyPI packages cannot have spaces in the name. There is no package named jupyter qtconsole , and no way to search for one...
Read more >
I'm getting an error indicating that the file path has a space ...
It created an error message saying that 2 spaces are not allowed, and so I have to do the installation in some other...
Read more >
Python3.3 venv pip fails to run if path contains spaces
Due to the way the shell or kernel parses the shebang, you can't have spaces in the path to the interpreter: http://lists.gnu.org/archive/html/ ...
Read more >
Pip Command Not Found on Windows: A Guide
A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found