Posting warning message

Cameron Simpson cs at cskk.id.au
Tue Jun 12 19:57:46 EDT 2018


On 12Jun2018 07:14, Tamara Berger <brgrt2 at gmail.com> wrote:
>On Tuesday, June 12, 2018 at 3:28:29 AM UTC-4, Cameron Simpson wrote:
>> On 11Jun2018 22:51, Tamara Berger <brgrt2 at gmail.com> wrote:
[...]
>> >192:~ TamaraB$ sudo python3 -m pip install pytest
>> >Password:
>> >The directory '/Users/TamaraB/Library/Caches/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.
>>
>> sudo leaves the $HOME environment variable unchanged, at least on my Mac. So it
>> is using your personal cache directory. And rejecting it becuse it is
>> (correctly) owned by you.
[...]
>
>Just one more thing, Cameron. I was looking at an Apple support page, and it says "When you're logged in to your Mac using an administrator account, you can use the sudo command in the Terminal app to execute commands as a different user, such as the root user." (https://support.apple.com/en-us/HT202035). I am logged in as administrator. So why isn't sudo working for me?

Please trim the quoted material of the irrelevant bits. Like the above. It 
makes things managable for others.

Sudo is working just fine: it is running pip as the root user. That's _all_ it 
does.

Pip itself makes certain sanity checks before it proceeds, and here it is 
complaining that its cache directory is not entirely owned by the user it is 
running as (root). That is because without the -H option it is trying to use 
_your_ cache directory.

Now, as root, it _could_ tread all over that directory with updates. But that 
would be rude, specificly because later, when _you_ go to run pip without sudo 
and with the --user option, portions of that cache directory will not be owned 
by you, and may not be readable or modifiable etc. So it refuses.

>P.S. How would I make the link I provided live?

What link? This is why we trim quoted text and reply below the relevant bit 
directly: I don't know what link you provided or even whether it is there, just 
buried in the huge quoted text. Just cite it again, eg:

  How would I make this link (link here) live?

And then, of course, tell us what "live" means :-)

Cheers,
Cameron Simpson <cs at cskk.id.au>



More information about the Python-list mailing list