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


相对与方法一,只要一个命令行就搞定不要方便的太多
$ brew search python3==> Searching local taps...python3==> Searching taps on GitHub...homebrew/linuxbrew-core/boost-python3==> Searching blacklisted, migrated and deleted formulae...
3、安装
brew install python3
报错:
curl: (18) transfer closed with 3530328 bytes remaining to readError: Checksum mismatch.Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104Actual: 9dbd52ae7bb95ecf6b1511e88651c5630e9b426a7b0b45b212b4459d0b0a0c9eArchive: /Users/xiatian/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gzTo retry an incomplete download, remove the file above.Error: Failed to upgrade vendor Ruby./usr/local/Homebrew/Library/Homebrew/brew.rb:10:in `

': Homebrew must be run under Ruby 2.6! You're running 2.3.3. (RuntimeError)/usr/local/Homebrew/Library/Homebrew/brew.rb:10:in `
': Homebrew must be run under Ruby 2.6! You're running 2.3.3. (RuntimeError)
第一个Error:
Archive: /Users/xiatian/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gzTo retry an incomplete download, remove the file above.#要重试未完成的下载,请删除上面的文件 。
解决:
不多说,删掉/Users/////-ruby-2.6.3...tar.gz这个文件 。
第二个Error:
Failed to upgrade vendor Ruby./usr/local/Homebrew/Library/Homebrew/brew.rb:10:in `
': Homebrew must be run under Ruby 2.6! You're running 2.3.3. (RuntimeError)
更新Ruby失败,必须运行在Ruby 2.6下!
我们运行的是Ruby 2.3.3 。
解决:
更新Ruby
4、查看Ruby版本
$ rvm list known#列出已知的ruby版本Warning, new version of rvm available '1.29.9-next', you are using older version '1.26.11'.
问题:
发现rvm版本也需要更新
5、更新rvm
$ rvm get stable
Downloading https://get.rvm.ioNo GPG software exists to validate rvm-installer, skipping.Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gzDownloading https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.ascFound PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc',but no GPG software exists to validate it, skipping.Upgrading the RVM installation in /Users/xiatian/.rvm/RVM PATH line found in /Users/xiatian/.mkshrc /Users/xiatian/.profile /Users/xiatian/.bashrc /Users/xiatian/.zshrc.RVM sourcing line found in /Users/xiatian/.profile /Users/xiatian/.bash_profile /Users/xiatian/.zlogin.Upgrade of RVM in /Users/xiatian/.rvm/ is complete.* RVM 1.30 simplifies behavior of 'rvm wrapper' subcommandThanks for installing RVM Please consider donating to our open collective to help us maintain RVM.Donate: https://opencollective.com/rvm/donateRVM reloaded!
6、安装Ruby最新版本2.6.5
$ rvm install ruby-2.6.5
Searching 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.Installing requirements for osx.Updating system...........Failed to update Homebrew, follow instructions athttps://docs.brew.sh/Common-Issuesand make sure `brew update` works before continuing..Error running 'requirements_osx_brew_update_system ruby-2.6.5',please read /Users/xiatian/.rvm/log/1574165496_ruby-2.6.5/update_system.logRequirements installation failed with status: 1.