Skip to content

./install_executorch.sh fails on pip due to dependency conflicts #9445

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

Closed
perheld opened this issue Mar 20, 2025 · 13 comments
Closed

./install_executorch.sh fails on pip due to dependency conflicts #9445

perheld opened this issue Mar 20, 2025 · 13 comments
Assignees
Labels
module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch

Comments

@perheld
Copy link
Collaborator

perheld commented Mar 20, 2025

🐛 Describe the bug

Cloning and setting up a new executorch as such:

git clone ...
git submodule sync
git submodule update --init
python3 -m venv env
source env/bin/activate
pip install -U pip setuptools wheel cmake pytest-cov zstd
./install_executorch.sh

Results in a dependency problem:

INFO: pip is looking at multiple versions of torchvision to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install torch==2.7.0.dev20250311 and torchvision==0.22.0.dev20250311+cpu because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested torch==2.7.0.dev20250311
    torchvision 0.22.0.dev20250311+cpu depends on torch==2.7.0.dev20250310

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

The only workaround I have right now is to change install_requirements.py

diff --git a/install_requirements.py b/install_requirements.py
index 9353dad18..e508e35e4 100644
--- a/install_requirements.py
+++ b/install_requirements.py
@@ -67,7 +67,7 @@ TORCH_NIGHTLY_URL = "https://download.pytorch.org/whl/nightly/cpu"
 # NOTE: If a newly-fetched version of the executorch repo changes the value of
 # NIGHTLY_VERSION, you should re-run this script to install the necessary
 # package versions.
-NIGHTLY_VERSION = "dev20250311"
+NIGHTLY_VERSION = "dev20250310"

Versions

Running on latest greatest

cc @larryliu0820 @jathu @lucylq

@robell
Copy link
Collaborator

robell commented Mar 20, 2025

It seems like the CI does “./install_executorch.sh --use-pt-pinned-commit” which i assume is avoiding this by pulling a different pin. Not sure why the default is then “a random later” version? perhaps the other way round which is a pin by default, and --use-latest-pt if you want to explore...

@kimishpatel
Copy link
Contributor

@Jack-Khuu who is the right PoC to resolve this? cc: @byjlw @mergennachin

@mergennachin
Copy link
Contributor

@jathu @larryliu0820 are the build/install PoC, not @Jack-Khuu

@perheld - i'm actually trying to reproduce on my machine -- tried on both mac and linux, it is able to succeed to install_executorch.sh

could you try again on the latest main?

@mergennachin
Copy link
Contributor

>>> import torch
>>> import torchaudio
>>> import torchvision
>>> torch.__version__
'2.7.0.dev20250311'
>>> torchvision.__version__
'0.22.0.dev20250311'
>>> torchaudio.__version__
'2.6.0.dev20250311'
>>>

@mergennachin mergennachin added the module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch label Mar 20, 2025
@kimishpatel
Copy link
Contributor

@jathu @larryliu0820 are the build/install PoC, not @Jack-Khuu

@perheld - i'm actually trying to reproduce on my machine -- tried on both mac and linux, it is able to succeed to install_executorch.sh

could you try again on the latest main?

ok I looked at our run book that listed Jack for everything else

@zingo
Copy link
Collaborator

zingo commented Mar 20, 2025

I retried on latest and first got the problem but I was now able to fix it with a --clean
e.g. this work for me (kind of sure I tests this a few days also not sure if using and it didn't help then)

./install_executorch.sh --clean
./install_executorch.sh

I did a run with./install_executorch.sh --pybind xnnpack to test that in between that worked, so I'm unsure if that fixed something.

For ref this was on
6fb42ef [ET-VK] Adding boolean parameters to add_copy_offset_node to specify index calculation function in copy op's shader. (#9437)

We going to see if I could verify #9453
but now I don't see the problem anymore.

@zingo zingo closed this as completed Mar 20, 2025
@zingo zingo reopened this Mar 20, 2025
@mergennachin
Copy link
Contributor

@zingo @perheld - can we close this then?

@zingo
Copy link
Collaborator

zingo commented Mar 21, 2025

A spoke too soon I still get the error, I by a mixup put back the change per mention e.g set the version to NIGHTLY_VERSION = "dev20250310" in install_requirements.py
And seem to have got a false positive, sorry for the confusion

And now with #9453 merged the workaround dont work anymore, I assume you have to "revert" all chnagewd back to dev20250310

@dreamqin68
Copy link

I encountered a similar error when using the latest release v0.5.0. After running ./install_executorch.sh, I got the following error:

Collecting timm==1.0.7
  Using cached timm-1.0.7-py3-none-any.whl.metadata (47 kB)
ERROR: Cannot install timm==1.0.7, torch==2.6.0, torchaudio==2.6.0 and torchvision==0.21.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested torch==2.6.0
    torchvision 0.21.0 depends on torch==2.6.0
    timm 1.0.7 depends on torch
    torchaudio 2.6.0 depends on torch==2.7.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

@kimishpatel
Copy link
Contributor

Doesnt look like this is resolved yet cc next oncall @JacobSzwejbka

@jathu
Copy link
Contributor

jathu commented Mar 25, 2025

@perheld we updated the version on main, please try again

@perheld
Copy link
Collaborator Author

perheld commented Mar 26, 2025

Works fine now. I was worried I was going insane and nobody else seeing this. 😅

@perheld perheld closed this as completed Mar 26, 2025
@zingo
Copy link
Collaborator

zingo commented Mar 27, 2025

Worked for me also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch
Projects
None yet
Development

No branches or pull requests

7 participants