Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to see where exactly torch is installed pip vs conda torch installation

On my machine i can't "pip install torch" - i get infamous "single source externally managed error" - i could not fix it and used "conda install torch" from anaconda.

Still, checking version is easy - torch.__version__

But how to see where is it installed -the home dir of torch? Suppose if I had had both torches installed via pip and conda - how to know which one is used in a project?

import torch
print(torch__version__)
like image 876
ERJAN Avatar asked Dec 22 '22 17:12

ERJAN


1 Answers

You can get torch module location which is imported in your script

import torch
print(torch.__file__)
like image 111
Grigor Poghosyan Avatar answered Jan 31 '23 02:01

Grigor Poghosyan