Skip to content
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

Cant recognize PyTorch installed from conda #408

Open
hans66hsu opened this issue Jun 22, 2023 · 2 comments
Open

Cant recognize PyTorch installed from conda #408

hans66hsu opened this issue Jun 22, 2023 · 2 comments

Comments

@hans66hsu
Copy link

hans66hsu commented Jun 22, 2023

My environment already has Pytorch(1.12.1) installed with conda.

pytorch 1.12.1 py3.10_cuda11.3_cudnn8.3.2_0 pytorch
pytorch-cluster 1.6.0 py310_torch_1.12.0_cu113 pyg
pytorch-mutex 1.0 cuda pytorch
pytorch-scatter 2.1.0 py310_torch_1.12.0_cu113 pyg
pytorch-sparse 0.6.16 py310_torch_1.12.0_cu113 pyg

While I run pip install learn2learn the wheel cant recognize the existing pytorch and installed another new one (Pytorch 2.0.1). It should be "satisfied" instead of "collecting" if the package was recognized.

Collecting torch>=1.1.0 (from learn2learn)
Using cached torch-2.0.1-cp310-cp310-manylinux1_x86_64.whl (619.9 MB)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /media/storage/dl_env/miniforge3/envs/DC_50/lib/python3.10/site-packages (from torchvision>=0.3.0->learn2learn) (9.5.0)

At the end, my original PyTorch was removed due to conflicts.

Attempting uninstall: torch
Found existing installation: torch 1.12.1
Uninstalling torch-1.12.1:
Successfully uninstalled torch-1.12.1

The output of which -a pip:

...../miniforge3/envs/DC_50/bin/pip

The reason I need PyTorch 1.12.1 is for compatibility with other learning framework packages (such as PyG). Do you know any reasons why it can't recognize the already installed PyTorch?

@seba-1511
Copy link
Member

Hello @hans66hsu,

I'm not sure why this is happening, maybe try to reinstall the PyTorch version you'd like to use? learn2learn should be compatible with any pytorch>=1.1.0 (which is what we specify in the requirements).

@hans66hsu
Copy link
Author

hans66hsu commented Jun 23, 2023

I suspected it's because PyTorch is named "pytorch" instead of "torch" when installing from conda. I solved it by removing torch and torchvision in setup.py and built it in pip install -e . It would be nice if a conda version can be released in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants