pip freeze > requirements.txt - permission denied with sudo? (heroku- flask tutorial) pip freeze > requirements.txt - permission denied with sudo? (heroku- flask tutorial) flask flask

pip freeze > requirements.txt - permission denied with sudo? (heroku- flask tutorial)


looks like you don't have write permission in the folder your working in. This should solve the issue.

sudo sh -c 'sudo pip freeze > requirements.txt'


The parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Try using

sudo -H sh -c 'sudo pip freeze > requirements.txt'