1

This question already has an answer here:

I wanted to install cx_freeze or pyInstaller for running my python game also on cross platforms without the need of having installed python3 and pygame. But the command sudo pip install cx_freeze (or pyInstaller) as indicated on their makers webpages doesn't work for me. The error that always occurs then is the following:

The directory '/home/h3friend/.cache/pip/http' or its 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. The directory '/home/h3friend/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Has anyone an idea what I need to do in order to fix this?

Thanks in advance!

marked as duplicate by karel, Eric Carvalho, muru command-line Mar 20 '17 at 13:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Pip needs to use files in your home directory, owned by the current user, to run, and sudo to run globally, which changes your user to the root user. Sudo's -H flag (mentioned in the error message) will make sudo behave as if you still own your home directory.

TL;DR:

Do sudo -H pip install cx_freeze.

Not the answer you're looking for? Browse other questions tagged or ask your own question.