Python3安装完全攻略 Mac篇( 三 )


再次运行:
$ brew install rubyUpdating Homebrew...Error: readline: undefined method `undent' for #
解决
先运行下面命令
$ rvm autolibs read-only
再安装:
$ rvm install ruby-2.6.5Searching for binary rubies, this might take some time.No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.Checking requirements for osx.Missing required packages: coreutils readline zlib openssl@1.1Somehow it happened there is no executable 'openssl',run 'brew doctor' and make sure latest 'openssl@1.1' is installed properly.Requirements installation successful.
查看版本:
$ ruby -vruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
安装成功 。
在上面的安装过程,发现我们的版本也需要更新 。
7、更新
$ brew update
报错:
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
解决方案:
$ cd$ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install$ vim brew_install
进入到
按 i 进入编辑模式
更改脚本中的资源链接,替换成中国科学技术大学的镜像就是把这两句 BREW_REPO = “https://github.com/Homebrew/brew“.freeze CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze 更改为这两句 BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git".freezeCORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git".freeze
改完如下图 。
按ESC退出编辑模式,输入:wq 退出并保存 。
$ rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core// 执行下面这句命令,更换为中科院的镜像:$ git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrewCloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew'...remote: Counting objects: 656959, done.remote: Total 656959 (delta 0), reused 0 (delta 0)Receiving objects: 100% (656959/656959), 213.43 MiB | 2.02 MiB/s, done.Resolving deltas: 100% (431789/431789), done.Checking out files: 100% (5104/5104), done.// 把homebrew-core的镜像地址也设为中科院的国内镜像$ cd "$(brew --repo)" Homebrew $ git remote set-url origin https://mirrors.ustc.edu.cn/brew.gitHomebrew $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" -bash: cd: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core: No such file or directory
报错:
没有这个文件 。
解决:
找一下这个目录:
/usr/local///Taps//-core
发现这个目录竟然不存在,那我们就来手动创建一个:
$ sudo mkdir/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
再执行一遍:
Homebrew $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" homebrew-core $ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
这下顺利运行,再来安装 。
8、安装
$ brew install python3