Skip to content

Permissions issue when linking python3 #19286

Closed
@JasonTheAdams

Description

@JasonTheAdams

Gist Logs: https://gist.github.com/37a31433396016024e15632dfe27b638

Greetings! Python3 was installed as a dependency of asciinema (brew install asciinema) after updating, but it got stuck when linking python3, giving the following:

Linking /usr/local/Cellar/python3/3.6.3... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

I ran brew doctor, and it said to run brew link python3. That produced the same error message as before.

I tried searching around for this, but couldn't quite find a clear answer as what to do. If I understand correctly, it's no longer necessary (or recommended) to change the owner of /usr/local/.

Appreciate any guidance on this!

Activity

fxcoudert

fxcoudert commented on Oct 11, 2017

@fxcoudert
Member

Can you tell us if you have a /usr/local/Frameworks directory, and what permissions it has?
Paste here the output of ls -lh /usr/local.

chingNotCHing

chingNotCHing commented on Oct 12, 2017

@chingNotCHing

Same as your problem. This works for me.

>sudo mkdir /usr/local/Frameworks
>sudo chown $(whoami):admin /usr/local/Frameworks
liaodongxiaoxiao

liaodongxiaoxiao commented on Oct 13, 2017

@liaodongxiaoxiao

@chingNotCHing Thank you

JasonTheAdams

JasonTheAdams commented on Oct 14, 2017

@JasonTheAdams
Author

@fxcoudert Nope, it doesn't currently exist.

drwxr-xr-x    3 jason  admin    96B Sep 29 22:57 Caskroom
drwxr-xr-x   42 jason  admin   1.3K Oct 10 14:47 Cellar
drwxr-xr-x   17 jason  wheel   544B Oct 10 14:36 Homebrew
drwxrwxr-x  228 jason  admin   7.1K Oct 10 16:17 bin
drwxr-xr-x   12 jason  admin   384B Sep 29 22:57 etc
drwxr-xr-x   12 jason  admin   384B Sep 29 22:57 git
drwxrwxr-x   45 jason  admin   1.4K Oct 10 14:57 include
drwxrwxr-x  125 jason  admin   3.9K Oct 10 14:59 lib
drwxr-xr-x   56 jason  admin   1.8K Oct 10 16:17 opt
drwxr-xr-x    3 root   wheel    96B Sep 29 22:56 remotedesktop
drwxr-xr-x    4 jason  wheel   128B Oct 10 14:57 sbin
drwxrwxr-x   13 jason  admin   416B Oct 10 14:59 share
drwxr-xr-x    6 jason  admin   192B Oct 10 14:57 var

Here's the permission of the parent /usr/local/ directory:

drwxr-xr-x   16 root  wheel   512B Sep 29 22:57 local

My understanding (@chingNotCHing) is that it's not a good idea to change the owner of /usr/local/ to something other than root. I suppose I could make the Frameworks directory and set it to jason:admin. 🤔

abonillabeeche

abonillabeeche commented on Oct 17, 2017

@abonillabeeche

@JasonTheAdams after doing the option from above and running "brew link python3" I still get

→ asciinema 
Traceback (most recent call last):
  File "/usr/local/Cellar/asciinema/1.4.0/libexec/bin/asciinema", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

Is this the case for you too?

edwardmp

edwardmp commented on Oct 18, 2017

@edwardmp

@abonillasuse, @chingNotCHing's stuff does not work for you because he made a typo (there is missing slash in the second command)

This is the correct one

sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks
aramprice

aramprice commented on Oct 19, 2017

@aramprice

Is there any info on why the /usr/local/Frameworks was not present? Is this a brew installation bug/issue?

JCount

JCount commented on Oct 19, 2017

@JCount
Contributor

The /usr/local/Frameworks directory should be created by the install script if it does not already exist.

JasonTheAdams

JasonTheAdams commented on Oct 19, 2017

@JasonTheAdams
Author

Manually creating the /user/local/Frameworks directory and setting the permissions fixed the issue for me. Not sure why the directory wasn't created in the first place. I've been using homebrew for a while so maybe it wasn't added in an upgrade script.

JCount

JCount commented on Oct 19, 2017

@JCount
Contributor

If you installed using the install script before Homebrew/install#59 was merged, it is possible it was never created. It also is possible that a system/software update removed the /usr/local/Frameworks dir or changed its permissions, it is hard to tell.

aramprice

aramprice commented on Oct 20, 2017

@aramprice

@JCount thank you for the info/explanation.

@JasonTheAdams manually creating the directory sorted things for me as well, thanks!

ilovezfs

ilovezfs commented on Oct 20, 2017

@ilovezfs
Contributor

@JasonTheAdams thanks for reporting the issue and I'm glad to hear you got it working.

Jawknee-88

Jawknee-88 commented on Nov 19, 2017

@Jawknee-88

I faced this same issue after upgrading to macOS High Sierra. I had to recreate the /usr/local/ dirs Framework, include and lib which were deleted during the OS upgrade and then run

sudo chown -R $(whoami) $(brew --prefix)/*

to set permissions on the new directories.

folushooladipo

folushooladipo commented on Dec 8, 2017

@folushooladipo

@chingNotCHing Thanks for your answer. It worked for me, but not after I corrected the second command, which was missing a forward slash, /. So, it should be local/Frameworks not localFrameworks.

DandelionField

DandelionField commented on Dec 17, 2017

@DandelionField

I had a similar issue but wasn't able to resolve it by creating /usr/local/Frameworks. Instead, I created /usr/local/lib and followed @chingNotCHing's advice on how to assign permissions. It worked after that.

locked and limited conversation to collaborators on Dec 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @aramprice@edwardmp@fxcoudert@JasonTheAdams@chingNotCHing

        Issue actions

          Permissions issue when linking python3 · Issue #19286 · Homebrew/homebrew-core