Can I resolve import torch from external computer?

Hello Pytorch experts
I am Han Seok-hoon, a researcher. I am creating a Python file that analyzes image data using the Yolov5 algorithm.

However, when I try to run the file, there is no problem because the conda environment is well established on my local computer.

However, when running the corresponding Python file on an external computer, the conda environment is not built, so the torch suitable for the environment will not be installed.

Then, in this case, “import torch” cannot be performed, and the program will not be executed.

Is it not possible to prevent the error of “import torch” from occurring when I run the program written on my local computer on an external computer?

Is there a solution other than building a development virtual environment on an external computer?

Please let me know if you have any other workarounds or suggestions. For me, that help is desperate.

If the packages are not installed and not found in the right PATH in the environment, it wont simply run.
My first strategy would be to analyze environment in which to run your program, to see which python version, python packages are installed.

Then, maybe look for other config settings about the VM relevant to torch, python. OS type and version.

If possible, you could do these with a bash script.

If right packages and settings are not there, next step would be to find right environment.
Maybe conda environment/venv is already built and you just need to activate it.

Last step would be to create the environment ( I kept this as a last step as per your request).
I don’t understand why you don’t want to create environment, (not enough privilege maybe ??)
Its like asking using package without having to install it :slight_smile: