Skip to content

Instantly share code, notes, and snippets.

@skilbjo
Created January 29, 2014 08:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skilbjo/8683709 to your computer and use it in GitHub Desktop.
Save skilbjo/8683709 to your computer and use it in GitHub Desktop.
Fix brew doctor
## guide for mavericks 10.9 configuration + python development environment setup
http://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/
http://hackercodex.com/guide/python-development-environment-on-mac-osx/
## installing xcode command line tools
xcode-select --install
## installing homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
brew doctor
Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:
/usr/local/share/man/de
/usr/local/share/man/de/man1
/usr/local/share/man/mann
Warning: You have MacPorts or Fink installed:
/opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libtcl8.6.dylib
/usr/local/lib/libtk8.6.dylib
/usr/local/lib/libusb-1.0.0.dylib
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc
/usr/local/lib/pkgconfig/valgrind.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
ccmake
cmake
cmakexbuild
cpack
ctest
Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
## fix brew errors
http://stackoverflow.com/questions/16462949/homebrew-brew-doctor-throwing-up-a-lot-of-errors-how-can-i-fix-them
## change ownership of certain folders
sudo chown -R graceyeo:admin /usr/local/share/man/de
sudo chown -R graceyeo:admin /usr/local/share/man/de/man1
sudo chown -R graceyeo:admin /usr/local/share/man/mann
## uninstall macports
http://stackoverflow.com/questions/7751427/prevent-warning-about-macports-fink-installation
http://guide.macports.org/chunked/installing.macports.uninstalling.html
sudo port -fp uninstall installed
sudo rm -rf \
/opt/local \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0 \
~/.macports
## Removed from .bash_profile
##
# Your previous /Users/graceyeo/.bash_profile file was backed up as /Users/graceyeo/.bash_profile.macports-saved_2013-05-30_at_16:54:38
##
# MacPorts Installer addition on 2013-05-30_at_16:54:38: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
## unexpected files and libraries
http://stackoverflow.com/questions/10580813/how-do-i-fix-brew-doctor-errors
mv /usr/local/lib/libtcl8.6.dylib .
mv /usr/local/lib/libtk8.6.dylib .
mv /usr/local/lib/libusb-1.0.0.dylib .
mv /usr/local/lib/pkgconfig/tcl.pc /usr/local/lib/pkgconfig/tk.pc /usr/local/lib/pkgconfig/valgrind.pc /usr/local/lib/libtclstub8.6.a /usr/local/lib/libtkstub8.6.a .
## update brew
brew update
Updated Homebrew from ff02410f to f74d6141.
==> Updated Formulae
grass riemann voms
brew install bash-completion ssh-copy-id wget
## install python
brew install python --with-brewed-openssl
==> Installing dependencies for python: pkg-config, readline, sqlite, gdbm, openssl
==> Installing python dependency: pkg-config
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config-0.28.mavericks.bot
######################################################################## 100.0%
==> Pouring pkg-config-0.28.mavericks.bottle.2.tar.gz
🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 604K
==> Installing python dependency: readline
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/readline-6.2.4.mavericks.bott
######################################################################## 100.0%
==> Pouring readline-6.2.4.mavericks.bottle.1.tar.gz
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
OS X provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/readline/lib
CPPFLAGS: -I/usr/local/opt/readline/include
==> Summary
🍺 /usr/local/Cellar/readline/6.2.4: 31 files, 1.6M
==> Installing python dependency: sqlite
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/sqlite-3.8.1.mavericks.bottle
######################################################################## 100.0%
==> Pouring sqlite-3.8.1.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
OS X provides an older sqlite3.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/sqlite/lib
CPPFLAGS: -I/usr/local/opt/sqlite/include
==> Summary
🍺 /usr/local/Cellar/sqlite/3.8.1: 9 files, 2.0M
==> Installing python dependency: gdbm
==> Downloading http://ftpmirror.gnu.org/gdbm/gdbm-1.10.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/gdbm/1.10 --mandir=/usr/local/Cellar/gdbm/1.10/share/ma
==> make install
🍺 /usr/local/Cellar/gdbm/1.10: 11 files, 240K, built in 15 seconds
==> Installing python dependency: openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
################################################ 67.4%
curl: (18) transfer closed with 1453980 bytes remaining to read
Trying a mirror...
==> Downloading http://mirrors.ibiblio.org/openssl/source/openssl-1.0.1e.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr/local/etc/openssl
==> make depend
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1e/share/man MANSUFFIX=ssl
==> security find-certificate -a -p /Library/Keychains/System.keychain > '/usr/local/etc/openssl/o
==> security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> '
==> mv -f /usr/local/etc/openssl/osx_cert.pem.tmp /usr/local/etc/openssl/osx_cert.pem
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The OpenSSL provided by OS X is too old for some software.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.1e: 429 files, 15M, built in 4.4 minutes
==> Installing python
==> Downloading http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python/2.7.6 --enable-ipv6 --datarootdir=/usr/local/Cel
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.6
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.6/share/python
==> Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-1.3.2.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/python/2.7.6/bin/python -s setup.py --no-user-cfg install --force --verbose
==> Downloading https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/python/2.7.6/bin/python -s setup.py --no-user-cfg install --force --verbose
==> Caveats
Python demo
/usr/local/share/python/Extras
Setuptools and Pip have been installed. To update them
pip install --upgrade setuptools
pip install --upgrade pip
To symlink "Idle" and the "Python Launcher" to ~/Applications
`brew linkapps`
You can install Python packages with (the outdated easy_install or)
`pip install <your_favorite_package>`
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python
Warning: Could not link python. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link python'
Possible conflicting files are:
/usr/local/bin/pip-2.7
/usr/local/bin/pip
==> Summary
🍺 /usr/local/Cellar/python/2.7.6: 5225 files, 80M, built in 2.6 minutes
## resolving errors from brew python installation
http://stackoverflow.com/questions/13088998/homebrew-python-installing
sudo chown -R graceyeo /usr/local
brew uninstall -f python
rm -rf 'brew --cache'
brew cleanup
brew prune
brew doctor
brew install python --with-brewed-openssl
http://stackoverflow.com/questions/19340871/how-to-link-home-brew-python-version-and-set-it-as-default
http://stackoverflow.com/questions/13354207/how-to-symlink-python-in-homebrew
brew link --overwrite --dry-run python
Would remove:
/usr/local/bin/pip-2.7
/usr/local/bin/pip
## key command for making the link work
brew link --overwrite python
Linking /usr/local/Cellar/python/2.7.6... 34 symlinks created
pip install --upgrade setuptools
pip install --upgrade pip
## already have git installed
brew install git
which git
/usr/local/bin/git
/usr/bin/git --version
git version 1.8.3.4 (Apple Git-47)
http://www.lowindata.com/2013/installing-scientific-python-on-mac-os-x/
which python
/usr/local/bin/python
## installing virtualenv
pip install virtualenv
http://stackoverflow.com/questions/18396210/installing-virtualenv-using-homebrew-and-pip-on-mac-os-x-10-8-4
pip install virtualenvwrapper
http://virtualenvwrapper.readthedocs.org/en/latest/
source /usr/local/bin/virtualenvwrapper.sh
add source /usr/local/bin/virtualenvwrapper.sh to ~/.bash_profile
## superhero-themed environments
mkvirtualenv wintersoldier
pip install numpy
brew install gfortran
pip install scipy
brew install freetype
pip install matplotlib
export LDFLAGS="-L/usr/local/opt/freetype/lib"
export CFLAGS="-I/usr/local/opt/freetype/include"
http://stackoverflow.com/questions/12363557/matplotlib-install-failure-on-mac-osx-10-8-mountain-lion
LDFLAGS="-L/usr/local/opt/freetype/lib -L/usr/local/opt/libpng/lib" CPPFLAGS="-I/usr/local/opt/freetype/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/include/freetype2" pip install matplotlib
pip install ipython
## install qtconsole
## download library from
https://qt-project.org/downloads
brew install pyqt
add to .bash_profile
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
brew install zmq
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine,
you may need to do:
ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq
pip install pyzmq
pip install pygments
## for more libraries that could be useful e.g. pandas, BeautifulSoup
http://joernhees.de/blog/2013/06/08/mac-os-x-10-8-scientific-python-with-homebrew/
sudo rm -rf /Library/Frameworks/R.framework /Applications/R.app \
> /usr/bin/R /usr/bin/Rscript
brew tap homebrew/science
brew install R
R.framework was installed to:
/usr/local/opt/r/R.framework
To use this Framework with IDEs such as RStudio, it must be linked
to the standard OS X location:
sudo ln -s "/usr/local/opt/r/R.framework" /Library/Frameworks
To enable rJava support, run the following command:
R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
## is there an advantage/disadvantage to using homebrew/science to install numpy, scipy etc. vs pip?
## does brew install scipy (with homebrew/science) == pip install scipy for all intents and purposes?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment