Skip to content

Error in Pip Install Editable Mode #2871

Closed
@Jerry-Ge

Description

@Jerry-Ge

When trying to run the following command to install in editable mode:
pip install --editable . --config-settings editable_mode=strict --no-build-isolation

Hit the following error:

Building wheels for collected packages: executorch
  Building editable for executorch (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building editable for executorch (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [144 lines of output]
      [04/05/24 15:57:12] WARNING  pyproject.toml does not contain a setuptools.py:119
                                   tool.setuptools_scm section
      running editable_wheel
      creating /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info
      writing /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/dependency_links.txt
      writing entry points to /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/entry_points.txt
      writing requirements to /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/requires.txt
      writing top-level names to /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/top_level.txt
      writing manifest file '/tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/SOURCES.txt'
      adding license file 'LICENSE'
      writing manifest file '/tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch.egg-info/SOURCES.txt'
      creating '/tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch-0.1.0.dist-info'
      creating /tmp/pip-wheel-91gm0nbw/.tmp-sdag809b/executorch-0.1.0.dist-info/WHEEL
      running build_py
      creating /tmp/tmprwpw5zbw.build-lib/executorch
      creating /tmp/tmprwpw5zbw.build-lib/executorch/exir
      creating /tmp/tmprwpw5zbw.build-lib/executorch/exir/_serialize
      copying schema/scalar_type.fbs -> /tmp/tmprwpw5zbw.build-lib/executorch/exir/_serialize
      copying schema/program.fbs -> /tmp/tmprwpw5zbw.build-lib/executorch/exir/_serialize
      creating /tmp/tmprwpw5zbw.build-lib/executorch/sdk
      creating /tmp/tmprwpw5zbw.build-lib/executorch/sdk/bundled_program
      creating /tmp/tmprwpw5zbw.build-lib/executorch/sdk/bundled_program/serialize
      copying sdk/bundled_program/schema/bundled_program_schema.fbs -> /tmp/tmprwpw5zbw.build-lib/executorch/sdk/bundled_program/serialize
      copying sdk/bundled_program/schema/scalar_type.fbs -> /tmp/tmprwpw5zbw.build-lib/executorch/sdk/bundled_program/serialize
      running build_ext
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 156, in run
          self._create_wheel_file(bdist_wheel)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands
          self._run_build_subcommands()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 295, in _run_build_subcommands
          self.run_command(name)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/build_ext.py", line 88, in run
          _build_ext.run(self)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 465, in build_extensions
          self._build_extensions_parallel()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 488, in _build_extensions_parallel
          fut.result()
        File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
          return self.__get_result()
        File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
          raise self._exception
        File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
          result = self.fn(*self.args, **self.kwargs)
        File "<string>", line 235, in build_extension
        File "<string>", line 127, in src_path
      ValueError: Expected exactly one file matching 'third-party/flatbuffers/flatc'; found ()
      /usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py:988: _DebuggingTips: Problem in editable installation.
      !!
      
              ********************************************************************************
              An error happened while installing `executorch` in editable mode.
      
              The following steps are recommended to help debug this problem:
      
              - Try to install the project normally, without using the editable mode.
                Does the error still persist?
                (If it does, try fixing the problem before attempting the editable mode).
              - If you are using binary extensions, make sure you have all OS-level
                dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
              - Try the latest version of setuptools (maybe the error was already fixed).
              - If you (or your project dependencies) are using any setuptools extension
                or customization, make sure they support the editable mode.
      
              After following the steps above, if the problem still persists and
              you think this is related to how setuptools handles editable installations,
              please submit a reproducible example
              (see https://stackoverflow.com/help/minimal-reproducible-example) to:
      
                  https://github.com/pypa/setuptools/issues
      
              See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
              ********************************************************************************
      
      !!
        cmd_obj.run()
      Traceback (most recent call last):
        File "/home/x/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/x/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/x/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 273, in build_editable
          return hook(wheel_directory, config_settings, metadata_directory)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 436, in build_editable
          return self._build_with_temp_dir(
        File "/usr/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 448, in <module>
        File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 156, in run
          self._create_wheel_file(bdist_wheel)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands
          self._run_build_subcommands()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 295, in _run_build_subcommands
          self.run_command(name)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/build_ext.py", line 88, in run
          _build_ext.run(self)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 465, in build_extensions
          self._build_extensions_parallel()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 488, in _build_extensions_parallel
          fut.result()
        File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
          return self.__get_result()
        File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
          raise self._exception
        File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
          result = self.fn(*self.args, **self.kwargs)
        File "<string>", line 235, in build_extension
        File "<string>", line 127, in src_path
      ValueError: Expected exactly one file matching 'third-party/flatbuffers/flatc'; found ()
      [end of output]
  

The normal pip install . still works.

Metadata

Metadata

Assignees

Labels

actionableItems in the backlog waiting for an appropriate impl/fixmodule: build/installIssues related to the cmake and buck2 builds, and to installing ExecuTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

Status

Done

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions