When installing python3 enter python3 and it will not react

  • 2020-07-21 09:03:32
  • OfStack

I used brew to install python3

After loading, I found no response to the input of python3, and there was no problem with checking the $PATH

At this time, I went back to the installation process and found an error:


ERROR : The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink lib/pkgconfig/python-3.6.pc

(It seems to be this one, I forgot the screenshot when installing)
It just reminds you that brew doesn't have link to python3.

Then the computer kindly prompts you to use the link command


brew link python3

Solve!
.
.
A fart ah

Then I found it still didn't work, so I typed in the command to see what doctor said:


brew doctor

See what it says (mine is 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:
 pcre
 python3
 xz

Then there is warning, which will remind you how to change it. It will also remind you that xcode also needs to be updated, but if appstore does not remind you to update it, it is not the version of xcode.

After a search, I found that I need link xz first.

Then enter:


brew link xz

And then... Error:


Linking /usr/local/Cellar/xz/5.2.3... 
Error: Could not symlink lib/pkgconfig/liblzma.pc
/usr/local/lib/pkgconfig is not writable.

Then the computer tells you that this directory does not have write permission

Let's give him permission:

Input:


sudo chown -R $USER /usr/local/lib/pkgconfig 

Enter 1 more time, if there is any result of the following, it is promising:


brew link xz
Linking /usr/local/Cellar/xz/5.2.3... 53 symlinks created

At this time, you can use brew link 1 under python3 to have a look. I am worried about whether there will be any errors when installing python3, so I just reinstalled brew 1.

Try python3 at this point:


python3
Python 3.6.2 (default, Jul 17 2017, 16:44:45) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

I'm finally going to use theta =. =


Related articles: