It is better to use the homebrew package https://brew.sh or if you are using an old mac you can use macports https://www.macports.org/install.php, here you will find it easier to solve problems especially because of the larger community.