在 macOS Mojave 上使用 Home-brew 安装 pyenv 时出错

时间:2021-01-29 10:28:27

标签: homebrew macos-mojave pyenv

I was trying to install anaconda-navigator on macOS Mojave, but there was no meta-package for Python v 3.6. So, I tried to upgrade my python version to 3.8.  There was an article by Matthew Broberg titled - "The right and wrong way to set up Python 3 as default on a Mac" (https://opensource.com/article/19/5/python-3-default-mac).

a) The first step was to invoke 'xcode-select --install'.  Since, it was installed already.
I tried to 'brew -install pyenv'. 

I got this error

'''
错误:以下公式: git 不能作为二进制包安装,必须从源代码构建。 安装命令行工具: xcode-select --install 错误:必须安装 Git 并在您的 PATH 中! 错误:以下公式: pyenv 不能作为二进制包安装,必须从源代码构建。 安装命令行工具: xcode-select --install '''
b) 然后我跑了 'xcode-select --install'

Then I got a response
'code-select: note: install requested for command line developer tools'

There was a pop-up menu asking command line developer tools to be installed. I clicked OK. It installed fine.

c) Then I ran 'xcode-select --install'. I got a response saying that the command line tools was already installed.  

d) Then I tried running 

'brew install pyenv'

After a lengthy output which seemed fine, I got this error :

'/usr/local/Homebrew/Library/Homebrew/brew.rb:17:in `<main>': HOMEBREW_REQUIRED_RUBY_VERSION was not exported! Please call bin/brew directly! (RuntimeError)'

e) I was also not able to locate pyenv by using 'which pyenv'

0 个答案:

没有答案