Why installing pytorch with upgrading my python version?

Hi everyone,

So I need the anaconda environment with Python2.7. And when I am installing PyTorch as the official web said, Anaconda is always upgrading my python version, which completely confuses me.

At first, I thought it is because of that I am using the anaconda in Windows. But after I change to linux, same things happen.

Does anyone know how to install PyTorch using anaconda without upgrading the python version?

Any suggestion would help a lot.

PyTorch does not support python 2.7 on Windows

I am on MacOS and was able to install PyTorch using Conda for Python 2.7 without any issues. What are the steps you are taking? Could you provide some example output?

The steps I followed are below. I created a new conda environment name py2.7 and installed PyTorch.

$ conda create -n py2.7 python=2.7
$ source activate py2.7
$ conda install pytorch torchvision -c pytorch
$ python
Python 2.7.15 |Anaconda, Inc.| (default, May  1 2018, 18:37:05)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
1 Like

Hi @viraat,

I am using Anaconda2 and create the environment without ‘python=2.7’. But I check python version in the environment created and it is 2.7. But it just does not work. But by creating environment with ‘python2.7’, everything works fine. I cannot figure out why.

Anyway, problems solved. Thank you so much!

1 Like