Install pytorch from the source using pip
I am trying to install pytorch on a remote server. It has CentOS 6.5 and according to this link
it has stopped support for CentOS 6. So, I am trying to install it via source.
The recommended method to install is by anaconda but the thing is I am getting plenty of issues while installing anaconda as it is messing with the remote server path's alot so I have decided to use pip. But I have issues regarding converting some conda commands in pip which are as below-

conda install -c pytorch magma-cuda90
The above command is mentioned before the pytorch cloning step and it given me an error that Could not open requirements file: [Errno 2] No such file or directory: 'pytorch'
The other issue I am facing is below-
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
Wht should be the alternative for CMAKE_PREFIX_PATH in pip?

According to your Python version, you can try to install from the wheel files.

pip install https://download.pytorch.org/whl/cu101/torch-1.3.0-cp36-cp36m-manylinux1_x86_64.whl   --user # For torch 
pip install https://download.pytorch.org/whl/cu101/torchvision-0.4.1-cp36-cp36m-linux_x86_64.whl  --user # For torchvision


If it fails you may want to check your glibc version:

ldd --version


because PyTorch is supported on Linux distributions that use glibc >= v2.17.

For your question:


  What should be the alternative for `CMAKE_PREFIX_PATH in pip ?


CMAKE_PREFIX_PATH act as a build directive to indicate where to find modules needed for the build. In your case (installation as non-root with the --user flag) it's probably:

~/.local/lib/python3.6/site-packages

You can verify the exact location with the following command:

python -c "import site; print(site.getsitepackages()[0])"


As a side note your compilation will more likely fail if you still don't have the minimum required version of glibc.
