pip fails to install packages on moutain loin (Mac OS 10.8.2)

P

Peng Yu

Hi,

I installed Python using python-2.7.3-macosx10.6.dmg on my Mac OS
10.8.2.

When try to use pip to install packages, I get the following message.
Then the installation fails.

gcc-4.2 not found, using clang instead


I then create a link from /usr/bin/gcc to gcc-4.2. Then I run pip
again, I get the following error message.

Does anybody have a solution to install python on Mac OS 10.8.2 so
that packages can be installed with pip?

/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/exception:
42:28: error: bits/c++config.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/bits/stl_algobase.h:70,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/bits/char_traits.h:46,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/string:47,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/stdexcept:44,

Regards,
Peng
 
P

Prasad, Ramit

Peng Yu wrote
Hi,

I installed Python using python-2.7.3-macosx10.6.dmg on my Mac OS
10.8.2.

When try to use pip to install packages, I get the following message.
Then the installation fails.

gcc-4.2 not found, using clang instead


I then create a link from /usr/bin/gcc to gcc-4.2. Then I run pip
again, I get the following error message.

Does anybody have a solution to install pythonon Mac OS 10.8.2 so
that packages can be installed with pip?

/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/exception:
42:28: error: bits/c++config.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/bits/stl_algobase.h:70,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/bits/char_traits.h:46,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/string:47,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/stdexcept:44,

Regards,
Peng

I would install python+virtualenv+pip from MacPorts to keep
it separate from the OS X system Python. MacPorts will take
care of everything for you as long as you have Xcode installed.

`sudo ports install py27-pip`


Ramit Prasad


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
N

Ned Deily

Peng Yu said:
Hi,

I installed Python using python-2.7.3-macosx10.6.dmg on my Mac OS
10.8.2.

When try to use pip to install packages, I get the following message.
Then the installation fails.

gcc-4.2 not found, using clang instead


I then create a link from /usr/bin/gcc to gcc-4.2. Then I run pip
again, I get the following error message.

Does anybody have a solution to install python on Mac OS 10.8.2 so
that packages can be installed with pip?

/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/exception:
42:28: error: bits/c++config.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/bits/stl_algobase.h:70,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/bits/char_traits.h:46,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/string:47,
from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c+
+/4.2.1/stdexcept:44,

One issue is that you are mixing compilers and SDKs. Python 2.7.3 was
released about the time Apple released Xcode 4.3 which fundamentally
changed where SDKs are located. Xcode 4 no longer uses /Developer at
all, so what is there is likely left behind from 10.7 or earlier
versions of Xcode. Further, Xcode 4.5 which is the currently supported
version on 10.8 does not include an SDK for 10.6. 2.7.3 does have
support for using clang instead of the Xcode 3.2 gcc-4.2 it was built
with. This is untested but the simplest workaround if you are using
Xcode 4.4 or 4.5.* may be to just remove (or at least rename) /Developer

sudo mv /Developer /Developer-old

and make sure you have installed the Command Line Tools component of
Xcode 4.* (Xcode -> Preferences). If there is no directory at the
original SDK path (/Developer/SDKs/MacoOSX10.6.sdk), I believe distutils
will try to build without using an SDK, which may work. Also, you may
need to define env variable CXX if you are building c++:

export CXX=/usr/bin/g++
or export CXX=/usr/bin/clang++

The plan is for the next maintenance release of Python 2.7 to work
better with current Xocde 4.x on 10.7 and 10.7, as the newly released
Python 3.3.0 does.
 
N

Ned Deily

<5B80DD153D7D744689F57F4FB69AF4741671D3B6@SCACMX008.exchad.jpmchase.net>
,
Prasad said:
I would install python+virtualenv+pip from MacPorts to keep
it separate from the OS X system Python. MacPorts will take
care of everything for you as long as you have Xcode installed.

`sudo ports install py27-pip`

Yes, that should be another viable option as all of the components
should be built with the same version of the Xcode tool chain. Also,
some or all of the third-party packages may already be available as
MacPorts ports.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top