I am trying to install pytorch in Anaconda to work with Python 3.5 in Windows. Following the instructions in pytorch.org I introduced the following code in Anaconda:
For me it worked doing this:
Uninstall the previous version: go to C:\users\username\anaconda3 and run the anaconda-uninstall.exe
Install again anaconda
then run the following commands on the anaconda pompt:
conda create -n my_env python=2.7
conda activate my_env
start the gui app
conda install -c peterjc123 pytorch
anaconda-navigator
Go to the official PyTorch.org and follow the steps accordingly.
Select your preferences and you will see an appropriate command below on the page.
If you don't have GPU in the system, set CUDA as None
Example command:
conda install pytorch-cpu torchvision-cpu -c pytorch
Can you please try with below steps
conda create -n pytorch_env python=3.5
source activate pytorch_env
conda install -c soumith pytorch
python
> import torch
You can even find pytorch
after you execute command conda list
.
For windows python 3.6 and above without cuda
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
The following worked for me. First install MKL
:
conda install -c anaconda mkl
After this, install pytorch and torchvision:
conda install -c pytorch pytorch torchvision
For linux, cuda9.0, python3.6:
pip3 install http://download.pytorch.org/whl/cu90/torch-0.3.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
For other cuda/python version: check website: https://ptorch.com/news/145.html