So I want to install pytorch as a third party library with blender’s packaged python which is 3.7.0 I was wondering if any of you guys uses Blender and managed it to get this to work? Can you please share your methods? Installing torch in Blender would fail and tell me I should install torch with miniconda instead. Can someone help a fellow out? I am pulling my hairs out right now.
Edited:
Here is what I did to make pytorch work with Blender. Hopefully, this will help someone in the future.
I use Blender 2.8 which supposedly comes with its own python 3 and pip. The current python 3 version is 3.7 for my blender 2.8. What I did was install pytorch directly into Blender. Here are the steps.


Download and install Blender 2.8 beta


Go to your PATH from windows 10 system environment variables panel and find your Blender 2.8 installation directory then add it to PATH. For me this is
D:\Blender\blender-2.80-036ec5cae4f7-win64\blender-2.80.0-git.036ec5cae4f7-
windows64\2.80\python\Scripts


Open cmd and run it as administrator, I did it just to be safe. Then cd into
D:\Blender…\2.80\python\Scripts\bin\
This is where Blender’s default python is stored.


Now run the follow lines in order:
python -m ensurepip
python -m pip install --upgrade pip setuptools wheel


!IMPORTANT! Blender 2.8 now comes with a pre-installed Numpy and you need to go to Blender 2.8 site-packages dir and change the folder name. If you don’t do this after you install Pytorch it will fail. Pytorch will install another version on top of the pre existing Numpy causing version issues. The folder location of numpy and other packages is:
D:\Blender…\2.80\python\lib\site-packages\


Now you can go to the main Pytorch site and pick the correct pip3 installation instruction to run. Make sure the python version matches with Blender and not with other versions of python you have already installed. To make sure everything installed correctly you should open Blender 2.8 click on the scripting tab on top and try to import torch. If no error is shown you are now good to go.