Install pyqt via homebrew with `--with-python3` but still goes to Python 2 Here's my command and output (some command line arguments are left out):

$ brew reinstall pyqt --with-python3
==&gt; Reinstalling pyqt --with-python3
==&gt; Downloading http://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.10.3/PyQt-mac-
Already downloaded: /Library/Caches/Homebrew/pyqt-4.10.3.tar.gz
==&gt; Patching
patching file configure.py
==&gt; python configure.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4.10.3
==&gt; python ./configure-ng.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4
==&gt; make
==&gt; make install
==&gt; Caveats
Set PYTHONPATH if you want Python to find your site-packages:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
==&gt; Summary
  /usr/local/Cellar/pyqt/4.10.3: 560 files, 18M, built in 6.6 minutes


I suspect the formula of pyqt somehow hard-codes the python's version. For example it explicitly includes paths like python2.7/site-packages/. Here's the function install in the file:

  def install
    # On Mavericks we want to target libc++, this requires a non default qt makespec
    if ENV.compiler == :clang and MacOS.version &gt;= :mavericks
      ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++"
    end

    args = [ "--confirm-license",
             "--bindir=#{bin}",
             "--destdir=#{lib}/python2.7/site-packages",
             "--sipdir=#{share}/sip" ]
    # We need to run "configure.py" so that pyqtconfig.py is generated, which
    # is needed by PyQWT (and many other PyQt interoperable implementations such
    # as the ROS GUI libs). This file is currently needed for generating build
    # files appropriate for the qmake spec that was used to build Qt. This method
    # is deprecated and will be removed with SIP v5, so we do the actual compile
    # using the newer configure-ng.py as recommended.
    system "python", "configure.py", *args
    (lib/'python2.7/site-packages').install 'pyqtconfig.py'

    # On Mavericks we want to target libc++, this requires a non default qt makespec
    if ENV.compiler == :clang and MacOS.version &gt;= :mavericks
      args &lt;&lt; "--spec" &lt;&lt; "unsupported/macx-clang-libc++"
    end

    system "python", "./configure-ng.py", *args
    system "make"
    system "make", "install"
  end


But I am not sure whether it's safe to change the path directly in the source. Any ideas? Thank you.
You are right. The formula does hardcode the python version. I have worked on an updated version, and it should be available tonight.

Also, it is safe to change the path directly in the source. However, being a git repository it will complain if you have uncommitted changes when you want to update. Your best bet would be to just wait until tonight or tomorrow morning.