Some packages from brew require [email protected] as a dependency. For example:
$ brew deps vim
gdbm
gettext
libyaml
lua
[email protected]
perl
[email protected]
readline
ruby
sqlite
xz
However, I want to manage all my python installations with pyenv and I would not like to download [email protected] with brew. This would imply having to exactly same versions of python installed in 2 different locations, which I would like to avoid. Reading up on brew, pyenv and python I´ve come to understand that having python installed in different parts of the system may cause some trouble in the future, which I'd also like to avoid. Unfortunately I cannot seem to resolve the python dependency in brew packages through pyenv. Below follow the steps I've tried to overcome this.
I have installed pyenv with brew, and necessary python versions from there.
$ pyenv versions
system
* 3.8.2 (set by PYENV_VERSION environment variable)
I have tried solving this according to this Github discussion by setting a brew alias such as:
alias brew='env PATH=${PATH//$(pyenv root)\/shims:/} brew'
As that did not resolve the dependency issue, I tried create a link for [email protected]
in /usr/local/Cellar
which would point to the pyenv python, somehow similar to this issue with:
ln -s ~/.pyenv/versions/3.8.2 $(brew --cellar python)@3.8
This did not work, so I have also tried adding the link to ´/usr/local/bin´:
ln -s ~/.pyenv/versions/3.8.2 /usr/local/bin/[email protected]
However, running brew info vim
still shows that the [email protected] dependency is not satisfied.
$ brew info vim
vim: stable 8.2.0900 (bottled), HEAD
Vi 'workalike' with many additional features
https://www.vim.org/
Conflicts with:
ex-vi (because vim and ex-vi both install bin/ex and bin/view)
macvim (because vim and macvim both install vi* binaries)
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/vim.rb
==> Dependencies
Required: gettext ✘, lua ✘, perl ✘, [email protected] ✘, ruby ✘
Any ideas how can I link/connect my pyenv python installation to homebrew so that the additional [email protected] is not installed? Or maybe solve the issue in another manner using pyenv global/local/shell? I am currently using macOs Catalina.
Any help is greatly appreciated!