How to solve a installation problem


I am installing the pytorch by pytorch source code.

when i enter the command “python install”

occur [permission denied]

so i add “sudo python insall”

this command works well.

but problem is that pytorch package are installed in “/usr/local/lib/python3.7/dist-packages”

I want to change the installed directory to “~/.local/lib/python3.7/site-packages”

What i have to do?