简体   繁体   中英

Unable to install Python3 via Homebrew

I want to install python 3 via Homebrew. Here is the error I get:

Error: You must `brew link xz gdbm' before python3 can be installed

Now when I do 'brew link xz gdbm' I get this:

Linking /usr/local/Cellar/gdbm/1.11... Error: Could not symlink include/gdbm.h/usr/local/include is not writable.

I tried the following options to fix this:

sudo chown -R $USER /usr/local/bin/include
usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
   chown [-fhv] [-R [-H | -L | -P]] :group file ...

After this I tried to install python3 again but I am getting the same error. Please help.

/usr/local/include is not writable.

sudo chown -R $USER /usr/local/bin/include

您要添加的目录为/ usr / local / include或/ usr / local正确的目录。

I had the same problems. Run

brew doctor

(probably you also need to update brew if it's old with command brew update) and after warnings are cleared python installation should move forward without a hitch.

Please note you can run brew doctor as many times until all warnings are gone.

run

    brew doctor

then you'll see a diagnosis like this:

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:

  makedepend

it means you can fix by running this code:

 brew link makedepand

so now this works.

 brew install pyenv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM