Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.99k stars 11.36k forks source link

Can't install python after removing osx-gcc-installer on Mavericks #25249

Closed giancarlo3g closed 10 years ago

giancarlo3g commented 10 years ago

I've been trying to install python using brew on Mavericks for two weeks now. I followed a couple of guides on the web and made the horrible mistake of installing osx-gcc-installer which I removed later using the /Library/Developer/4.1/uninstall-devtools -mode=all command. After that, installed Xcode 5.0.1 and the CLT for 10.9 as recommended instead of using the osx-gcc-installer. Now, every time I run brew doctor, I get an error regarding a new version of CLT even when I've installed the latest. I think it has something to do with the osx-gcc-installer.

$ brew update
Already up-to-date.
$ brew --prefix
/usr/local
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 533b6b5d04bf354d88484c952880e10d79b4cbb4
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9-x86_64
Xcode: 5.0.1
CLT: 5.0.1.0.1.1382131676
Clang: 2.1 build 163
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
$ brew doctor
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.

Warning: A newer Command Line Tools release is available
Update them from Software Update in the App Store.

The specific error when doing brew install python:

==> 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/
==> make install
         ^
1 error generated.
make[1]: *** [testgdbm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install-recursive] Error 1
adamv commented 10 years ago

Xcode 5.0.2 is current:

$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: git@github.com:adamv/homebrew.git
HEAD: 52fe004dd257ccf105dc6a5fe4b9cd570285e6b7
HOMEBREW_PREFIX: /Users/adamv/.hb
HOMEBREW_CELLAR: /Users/adamv/homebrew/Cellar
CPU: 8-core 64-bit haswell
OS X: 10.9-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
GCC-4.2: build 5666
Clang: 5.0 build 500
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
giancarlo3g commented 10 years ago

Yes, but the CLT is still the same right? I also tried with Xcode 5.0.2 and got the same error. Then, decided to install 5.0.1 released on same date as CLT (october 22nd) as it is now.

adamv commented 10 years ago

Well this shouldn't be showing up at least: Clang: 2.1 build 163

We only support the most recently released compiler versions, so you will need to install Xcode 5.0.2 (and the CLT on top of that) to have a common ground to debug from.

giancarlo3g commented 10 years ago

I've just installed Xcode 5.0.2 but still have the same problem:

$ brew update
Already up-to-date.
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: a4fdb72dd872187d035cd913a20e5b37072d1496
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
Clang: 2.1 build 163
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
$ brew doctor
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.
Warning: A newer Command Line Tools release is available
Update them from Software Update in the App Store.

The error when installing python is still the same:

==> Installing python dependency: gdbm
==> Downloading http://ftpmirror.gnu.org/gdbm/gdbm-1.10.tar.gz
Already downloaded: /Library/Caches/Homebrew/gdbm-1.10.tar.gz
==> ./configure --prefix=/usr/local/Cellar/gdbm/1.10 --mandir=/usr/local/Cellar/gdbm/1.10/
==> make install
         ^
1 error generated.
make[1]: *** [testgdbm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install-recursive] Error 1
adamv commented 10 years ago

Clang: 2.1 build 163

There is still old osx-gcc-installer stuff left over that you need to remove. I've never installed this software so I don't know how to completely remove it.

mistydemeo commented 10 years ago

I'm not sure how to remove it either. The only way I know to clean it up is to install the CLT on top of it, via xcode-select --install at the terminal.

mistydemeo commented 10 years ago

If the version from xcode-select --install doesn't work, try the package from https://developer.apple.com/downloads

In 10.9, /usr/bin/clang is no longer the clang tool itself, but an xcselect wrapper that calls the real tool installed elsewhere (/Library/Developer/CommandLineTools for the CLT, /Applications/Xcode.app for Xcode). In prior versions, Xcode (4.2 and lower) and the CLT (4.x) installed straight into /usr. Unfortunately that means that your selector shim was overwritten with an ancient version of clang. I just checked and the version of CLT from the developer download site does appear to provide /usr/bin/clang, so it should overwrite osx-gcc-installer's bad version with the shim again.

giancarlo3g commented 10 years ago

Apparently, Clang 2.1 is under /usr/bin which Homebrew checks when running brew doctor. CLT has installed Clang 5.0 under /Library/Developer/CommandLineTools/usr/bin.

$ which clang
/usr/bin/clang
$ clang -v
Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
$ /Library/Developer/CommandLineTools/usr/bin/clang -v
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

I tried to modify the .bash_profile file to use Clang 5.0 but Homebrew always checks /usr/bin

$ brew doctor
/usr/local/Library/Homebrew/options.rb:19: command not found: /usr/bin/clang --version
/usr/local/Library/Homebrew/options.rb:19: command not found: /usr/bin/clang --version

However, brew --config shows the right version:

$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: a4fdb72dd872187d035cd913a20e5b37072d1496
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
Clang: 5.0 build 500
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
MikeMcQuaid commented 10 years ago

You've overwritten stuff on your system. Not much you can do beyond reinstalling or restoring from a backup at this point, sorry.

mistydemeo commented 10 years ago

The package from https://developer.apple.com/downloads will probably restore the /usr/bin/clang shim. Please try that.

giancarlo3g commented 10 years ago

If you mean to install CLT from de Developer website, I've already done it since the beginning. I guess I will have to reinstall Mavericks :/

MikeMcQuaid commented 10 years ago

@mpapis I suggest taking a look at this thread.

mpapis commented 10 years ago

hmm, I do not see RVM neither RailsInstaller in here - on Maverics RVM automatically installs CLT using found tricks with update center, there is no version of Railsinstaller for Mavericks because the trick used in RVM still relies on online connection and it's still not clear if you can embed CLT, can you explain in more details how it concerns me?

MikeMcQuaid commented 10 years ago

The same user here posted on the rails-installer bug tracker: https://github.com/railsinstaller/railsinstaller-nix/issues/19#issuecomment-30612888

mpapis commented 10 years ago

there is no version of RailsInstaller for Mavericks, the bug was opened for 10.8 - and is still valid and unresolved, and is the reason why there was no release for 10.9

MikeMcQuaid commented 10 years ago

If you try and install the 10.7 version of 10.9: what happens?

mistydemeo commented 10 years ago

Please add an appropriate warning on the site that users should not install RailsInstaller on 10.9! It's not clear that bad things will happen currently.

mpapis commented 10 years ago

this are users experimenting, we can add an extra note warning users to not use it on 10.9

MikeMcQuaid commented 10 years ago

It would be good if you added it to the code too, please.

adamv commented 10 years ago

Closing this in our repo, since we can't reasonably provide support for osx-gcc-installer issues; suggest asking https://github.com/kennethreitz/osx-gcc-installer/ about removal steps.

redbar0n commented 9 years ago

How to completely uninstall osx-gcc-installer and restore original system shims without reinstalling OSX Mavericks: http://magnemg.tumblr.com/post/113251602430/how-to-completely-uninstall-osx-gcc-installer

Torrent with original OSX Mavericks system shims: https://archive.org/details/completely_uninstall_osx-gcc-installer

Hope this helps someone. I already spent a ridiculous amount of time fixing this.