Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Python fails to install on MacOS 10.8 #13035

Closed
avaranovich opened this issue Jun 26, 2012 · 9 comments
Closed

Python fails to install on MacOS 10.8 #13035

avaranovich opened this issue Jun 26, 2012 · 9 comments
Labels

Comments

@avaranovich
Copy link

Hi,

Here is some interesting stuff from the output of brew install -v python

/usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.2/lib -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -L/usr/local/lib -L/usr/local/Cellar/readline/6.2.2/lib -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -L/usr/local/lib -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -isysroot /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -isystem /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline/6.2.2/include -isystem /usr/local/include -isysroot /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -isystem /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include build/temp.macosx-10.8-x86_64-2.7/private/tmp/homebrew-python-2.7.3-d2QK/Python-2.7.3/Modules/pyexpat.o build/temp.macosx-10.8-x86_64-2.7/private/tmp/homebrew-python-2.7.3-d2QK/Python-2.7.3/Modules/expat/xmlparse.o build/temp.macosx-10.8-x86_64-2.7/private/tmp/homebrew-python-2.7.3-d2QK/Python-2.7.3/Modules/expat/xmlrole.o build/temp.macosx-10.8-x86_64-2.7/private/tmp/homebrew-python-2.7.3-d2QK/Python-2.7.3/Modules/expat/xmltok.o -L/usr/local/Cellar/python/2.7.3/lib -L/usr/local/Cellar/readline/6.2.2/lib -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -L/usr/local/lib -o build/lib.macosx-10.8-x86_64-2.7/pyexpat.so **\* WARNING: renaming "pyexpat" since importing it failed: dlopen(build/lib.macosx-10.8-x86_64-2.7/pyexpat.so, 2): Symbol not found: __Py_HashSecret Referenced from: build/lib.macosx-10.8-x86_64-2.7/pyexpat.so Expected in: flat namespace in build/lib.macosx-10.8-x86_64-2.7/pyexpat.so ....

Python build finished, but the necessary bits to build these modules were not found:
_bsddb
dl
imageop
linuxaudiodev
ossaudiodev
spwd
sunaudiodev

To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Failed to build these modules:
_elementtree
_multiprocessing
_sqlite3
pyexpat
...

And finally

==> /usr/local/Cellar/python/2.7.3/bin/python setup.py install
/usr/local/Cellar/python/2.7.3/bin/python setup.py install
Traceback (most recent call last):
File "setup.py", line 38, in
exec(open(init_path).read(), d)
File "", line 8, in
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/setuptools/init.py", line 2, in
from setuptools.extension import Extension, Library
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/setuptools/extension.py", line 5, in
from setuptools.dist import _get_unpatched
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/setuptools/dist.py", line 6, in
from setuptools.command.install import install
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/setuptools/command/init.py", line 8, in
from setuptools.command import install_scripts
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/setuptools/command/install_scripts.py", line 3, in
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/pkg_resources.py", line 724, in
class Environment(object):
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/pkg_resources.py", line 727, in Environment
def init(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/pkg_resources.py", line 109, in get_supported_platform
plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))
File "/private/tmp/homebrew-UNKNOWN-0.6.27-LGhK/distribute-0.6.27/pkg_resources.py", line 221, in _macosx_vers
version = platform.mac_ver()[0]
File "/usr/local/Cellar/python/2.7.3/lib/python2.7/platform.py", line 804, in mac_ver
info = _mac_ver_xml()
File "/usr/local/Cellar/python/2.7.3/lib/python2.7/platform.py", line 781, in _mac_ver_xml
pl = plistlib.readPlist(fn)
File "/usr/local/Cellar/python/2.7.3/lib/python2.7/plistlib.py", line 78, in readPlist
rootObject = p.parse(pathOrFile)
File "/usr/local/Cellar/python/2.7.3/lib/python2.7/plistlib.py", line 401, in parse
from xml.parsers.expat import ParserCreate
File "/usr/local/Cellar/python/2.7.3/lib/python2.7/xml/parsers/expat.py", line 4, in
from pyexpat import *
ImportError: No module named pyexpat

Any ideas what's going wrong?

Brew doctor seems not heavily complaining:

Error: 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

Error: "config" scripts exist outside your system or Homebrew directories.
./configure scripts often look for *-config scripts to determine if
software packages are installed, and what 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:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

Error: /usr/X11 is a symlink
Homebrew's X11 support has only be tested with Apple's X11.
In particular, "XQuartz" and "XDarwin" are not known to be compatible.

Here is the build environment:

==> Build Environment
CPU: quad-core 64-bit sandybridge
MacOS: 10.8-x86_64
Xcode: 4.5 in '/Applications/Xcode45-DP1.app/Contents/Developer', CLT 4.4.0.0.1.1249367152
X11: /usr/X11 => /opt/X11
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -isysroot /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -isystem /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -fwrapv
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -isysroot /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -isystem /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -fwrapv
CPPFLAGS: -I/usr/local/Cellar/readline/6.2.2/include -isystem /usr/local/include -isysroot /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -isystem /Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include
LDFLAGS: -L/usr/local/Cellar/readline/6.2.2/lib -I/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -L/Applications/Xcode45-DP1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -L/usr/local/lib
MACOSX_DEPLOYMENT_TARGET: 10.8

Thanks,
Andrei

@2bits
Copy link
Contributor

2bits commented Jun 26, 2012

Until #13037 lands, it's hard to diagnose.

@samueljohn
Copy link
Contributor

At a first look, I think the config scripts found may perhaps be the cause. When the system python is mixed with the homebrew build thing will break. This is especially the case for SQLite bindings.

Show us your brew --config and please put such long outputs into a gist.github.com and link it here.

@samueljohn
Copy link
Contributor

Perhaps #12968 helps with (some?) of your problems here?

You could try to cd /usr/local, git checkout -b test and brew pull 12968 to check it.
Revert back via git checkout master

@avaranovich
Copy link
Author

Here is a brew --config output https://gist.github.com/3003312

@avaranovich
Copy link
Author

I tried #12968 and it worked for me!

@samueljohn
Copy link
Contributor

Thanks @avaranovich. Now I hope #12968 gets pulled soon.

@rors
Copy link

rors commented Jul 18, 2012

I also just tried #12968 as per the comment above, and it worked for me. Let's hope that gets pulled soon! Thanks.

@samueljohn
Copy link
Contributor

@rors Thanks for your test! I just have to integrate the latest code-review. Then I'll ask one of the core-members to pull the trigger :-)

@jalama
Copy link

jalama commented Aug 13, 2012

just to pile on #12968 worked for me also

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants