-
Notifications
You must be signed in to change notification settings - Fork 527
from executorch.exir import CaptureConfig
fails with ExecuTorch pip installed in editable mode
#9558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@larryliu0820 @GregoryComer have you guys worked on the pip build before? |
According to https://stackoverflow.com/questions/64838393/package-dir-in-setup-py-not-working-as-expected our current pattern cannot be supported in editable mode. Basically our file structure stopped us from doing I think this can't be fixed until we have an |
@larryliu0820 re: prioritization as backlog, note that this blocks building ExecuTorch through CMake with the pip installed in editable mode. |
@swolchok yeah to work around I think you can do |
…l module such as exir Summary: Fixes #9558. The `src/executorch/exir` file exists primarily due to the limitations of `pip install` in editable mode. Specifically, `pip install -e .` does not recognize `<executorch root>/exir` (or any root level directory with a `__init__.py`) as a valid package module because of the presence of `<executorch root>/exir/__init__.py`. See the following GitHub issue for details: [Issue #9558](#9558). To work around this limitation, a symlink is used. With this symlink and this package entry in `pyproject.toml`: ```toml [tool.setuptools.package-dir] ... "executorch" = "src/executorch" ``` We are telling `pip install -e .` to treat `src/executorch` as the root of the `executorch` package and hence mapping `executorch.exir` to `src/executorch/exir`. This allows us to perform `pip install -e .` successfully and enables the execution of the following command: ```bash python -c "from executorch.exir import CaptureConfig" ``` Test Plan: ```bash ./install_executorch.sh --pybind --editable python -c "from executorch.exir import CaptureConfig" ``` Reviewers: Subscribers: Tasks: Tags:
…l module such as exir (#9818) Summary: Fixes #9558. The `src/executorch/exir` file exists primarily due to the limitations of `pip install` in editable mode. Specifically, `pip install -e .` does not recognize `<executorch root>/exir` (or any root level directory with a `__init__.py`) as a valid package module because of the presence of `<executorch root>/exir/__init__.py`. See the following GitHub issue for details: [Issue #9558](#9558). To work around this limitation, a symlink is used. With this symlink and this package entry in `pyproject.toml`: ```toml [tool.setuptools.package-dir] # ... "executorch" = "src/executorch" ``` We are telling `pip install -e .` to treat `src/executorch` as the root of the `executorch` package and hence mapping `executorch.exir` to `src/executorch/exir`. This effectively gets `exir` out from the root level package. This allows us to perform `pip install -e .` successfully and enables the execution of the following command: ```bash python -c "from executorch.exir import CaptureConfig" ``` Test Plan: ```bash ./install_executorch.sh --pybind --editable python -c "from executorch.exir import CaptureConfig" ``` Reviewers: Subscribers: Tasks: Tags:
🐛 Describe the bug
python -c 'from executorch.exir import CaptureConfig'
works with ExecuTorch installed via ./install_executorch.sh, but fails with ExecuTorch installed bypip install -e .
:Versions
main
The text was updated successfully, but these errors were encountered: