Search code examples
pythonmacosgtkhomebrewgtk3

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb


I was tying to install mitmproxy

brew reinstall mitmproxy

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb!

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb!

Then I read this answer and tried the following, but same results.

brew reinstall pygobject3  gtk+3

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb!

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb!

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb!

Error: could not get runtime dependencies from /usr/local/opt/pygtk/.brew/pygtk.rb!

File /usr/local/opt/pygtk/.brew/pygtk.rb is present and its content is:

class Pygtk < Formula
  desc "GTK+ bindings for Python"
  homepage "http://www.pygtk.org/"
  url "https://download.gnome.org/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2"
  sha256 "cd1c1ea265bd63ff669e92a2d3c2a88eb26bcd9e5365e0f82c896e649f206912"
  revision 1

  option :universal

  depends_on "pkg-config" => :build
  depends_on "glib"
  depends_on "gtk+"
  depends_on "atk"
  depends_on "pygobject"
  depends_on "py2cairo"
  depends_on "libglade" => :optional

  def install
    ENV.append "CFLAGS", "-ObjC"
    ENV.universal_binary if build.universal?
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make", "install"

    # Fixing the pkgconfig file to find codegen, because it was moved from
    # pygtk to pygobject. But our pkgfiles point into the cellar and in the
    # pygtk-cellar there is no pygobject.
    inreplace lib/"pkgconfig/pygtk-2.0.pc", "codegendir=${datadir}/pygobject/2.0/codegen", "codegendir=#{HOMEBREW_PREFIX}/share/pygobject/2.0/codegen"
    inreplace bin/"pygtk-codegen-2.0", "exec_prefix=${prefix}", "exec_prefix=#{Formula["pygobject"].opt_prefix}"
  end

  test do
    (testpath/"codegen.def").write("(define-enum asdf)")
    system "#{bin}/pygtk-codegen-2.0", "codegen.def"
  end
end
brew doctor

Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae were deleted! You should find replacements for the following formulae: dirmngr gpg-agent
heroku mongodb node@6 phantomjs pygobject pygtk python@2

Warning: You have the following deprecated, official taps tapped:
Homebrew/homebrew-gui Homebrew/homebrew-science
Homebrew/homebrew-x11 Untap them with brew untap.

Warning: "config" scripts exist outside your system or Homebrew directories. ./configure scripts often look for *-config scripts to determine if software packages are installed, and which additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew-provided script of the same name. We found the following "config" scripts: /Users/ishandutta2007/.pyenv/shims/python-config
/Users/ishandutta2007/.pyenv/shims/python2-config
/Users/ishandutta2007/.pyenv/shims/python2.7-config
/Users/ishandutta2007/.pyenv/shims/python3-config
/Users/ishandutta2007/.pyenv/shims/python3.3-config
/Users/ishandutta2007/.pyenv/shims/python3.3m-config
/Users/ishandutta2007/.pyenv/shims/python3.4-config
/Users/ishandutta2007/.pyenv/shims/python3.4m-config
/Users/ishandutta2007/.pyenv/shims/python3.5-config
/Users/ishandutta2007/.pyenv/shims/python3.5m-config
/Users/ishandutta2007/.pyenv/shims/python3.6-config
/Users/ishandutta2007/.pyenv/shims/python3.6m-config
/Users/ishandutta2007/.pyenv/shims/python3.7-config
/Users/ishandutta2007/.pyenv/shims/python3.7m-config

Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run brew link on these: dirmngr
gpg-agent node@6 opencv python@2 [email protected] youtube-dl

Error: unknown or unsupported macOS version: :mountain_lion

brew config

HOMEBREW_VERSION: 2.4.11 ORIGIN: https://github.com/Homebrew/brew HEAD: 9ef993ab570ac6d4f2c4f88a96f2da8c3e71fa85 Last commit: 6 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap

HEAD: 209e837530c0363e60ee3cd8cc493bfca37d411a Core tap last commit: 43 minutes ago Core tap branch: master HOMEBREW_PREFIX: /usr/local

HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY:/private/tmp/com.apple.launchd.faf9YzPVVH/org.macosforge.xquartz:0

HOMEBREW_MAKE_JOBS: 4 CPU: quad-core 64-bit ivybridge Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby Clang: 10.0 build 1000 Git: 2.17.1 => /usr/local/bin/git Curl: 7.54.0 => /usr/bin/curl Java: 1.8.0_121 macOS: 10.13.6-x86_64 CLT: 10.1.0.0.1.1539992718 Xcode: 10.1 XQuartz: 2.7.11 => /opt/X11


Solution

  • Based on brew doctor here you go:

    brew uninstall pygtk pygobject
    brew install pyk+3 pygobject3
    brew install mitmproxy