How to solve a installation problem

Hi.

I am installing the pytorch by pytorch source code.

when i enter the command “python setup.py install”

occur [permission denied]

so i add “sudo python setup.py 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?