Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pytorch is not found & cannot be installed in pycharm

I need pytorch module to run my project. But When I tried to install it via command prompt via two different ways, it shows an error - Error in cmd installation.

C:\Users\Toothless>pip install torchvision --user
Collecting torchvision
Using cached https://files.pythonhosted.org/packages/b7/ff /091b4503d5f228bd1120db784e2c071617211b965a8a78018e75750c7199/torchvision-0.3.0-cp37-cp37m-win_amd64.whl
Requirement already satisfied: six in c:\users\toothless\appdata\local\programs\python\python37\lib\site-packages (from torchvision) (1.12.0)
Collecting pillow>=4.1.1 (from torchvision)
Downloading https://files.pythonhosted.org/packages/ae/96/6f83deebfcd20a5d4ad35e4e989814a16559d8715741457e670aae1a5a09/Pillow-6.1.0-cp37-cp37m-win_amd64.whl (2.0MB)
 |████████████████████████████████| 2.0MB 27kB/s
Requirement already satisfied: numpy in c:\users\toothless\appdata\local\programs\python\python37\lib\site-packages (from torchvision) (1.17.0)
 Collecting torch>=1.1.0 (from torchvision)
 ERROR: Could not find a version that satisfies the requirement torch>=1.1.0 (from torchvision) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
 ERROR: No matching distribution found for torch>=1.1.0 (from torchvision)

 C:\Users\Toothless>pip3 install torchvision
 Collecting torchvision
 Using cached https://files.pythonhosted.org/packages/b7/ff/091b4503d5f228bd1120db784e2c071617211b965a8a78018e75750c7199/torchvision-0.3.0-cp37-cp37m-win_amd64.whl
 Requirement already satisfied: six in c:\users\toothless\appdata\local\programs\python\python37\lib\site-packages (from torchvision) (1.12.0)
 Collecting torch>=1.1.0 (from torchvision)
 ERROR: Could not find a version that satisfies the requirement torch>=1.1.0 (from torchvision) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
 ERROR: No matching distribution found for torch>=1.1.0 (from torchvision)

Again I've tried to installed through pycharm enter image description here.

I've been following this question but conda`` is not listed in my envairoment variable.

Edited: When I tried pip install torch torchvision --user this command it gives an error - ERROR: torchvision 0.3.0 has requirement torch>=1.1.0, but you'll have torch 0.1.2.post2 which is incompatible.

Edited: I've also tried pip install torchvision but it shows with error -

C:\Users\Toothless>pip install torchvision
Collecting torchvision
Using cached https://files.pythonhosted.org/packages/b7/ff/091b4503d5f228bd1120db784e2c071617211b965a8a78018e75750c7199/torchvision-0.3.0-cp37-cp37m-win_amd64.whl
Collecting torch>=1.1.0 (from torchvision)
ERROR: Could not find a version that satisfies the requirement torch>=1.1.0 (from torchvision) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch>=1.1.0 (from torchvision)

What should i do now to make a workable pytorch?

like image 666
mefahimrahman Avatar asked Jan 21 '26 10:01

mefahimrahman


2 Answers

Finally I've installed my desired pytorch & torchvision. I've installed it via pip. The commandline I've used to install pytorch:

pip3 install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl

And for torchVision:

pip3 install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp37-cp37m-win_amd64.whl

I've found this code from PyTorch website.

The requirement I've used

like image 111
mefahimrahman Avatar answered Jan 24 '26 00:01

mefahimrahman


Check with:

pip install torchvision --no-deps

It can be because of the dependencies.

like image 30
Kermit the Frog Avatar answered Jan 24 '26 01:01

Kermit the Frog



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!