[New-bugs-announce] [issue11334] Failed to build _multiprocessing on Mac OS X

dave report at bugs.python.org
Sat Feb 26 17:53:01 CET 2011

New submission from dave <dev66 at gmx.de>:

hi community,

i cannot import multiprocessing since it fails(?) during build.
could someone point out a solution for me?

thanks a lot in advance.

$ python
Python 2.7.1 (r271:86832, Feb 26 2011, 17:19:29) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import threading
>>> import multiprocessing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tools/python/lib/python2.7/multiprocessing/__init__.py", line 83, in <module>
    import _multiprocessing
ImportError: No module named _multiprocessing

This is what i did to compile python 2.7:

export ARCHFLAGS="-arch i386"
export CXXFLAGS="-arch i386"
export CFLAGS="-arch i386"
export FFLAGS="-arch i386"
export LDFLAGS="-Wall -undefined dynamic_lookup -arch i386"

checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... darwin
checking machine type as reported by uname -m... i386
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for --with-cxx-main=<compiler>... no
checking for g++... g++
config.status: pyconfig.h is unchanged
creating Modules/Setup
creating Modules/Setup.local
creating Makefile

make -j 4
/private/var/tmp/Python-2.7.1/Modules/_multiprocessing/semaphore.c: In function 'semlock_acquire':
/private/var/tmp/Python-2.7.1/Modules/_multiprocessing/semaphore.c:314: warning: implicit declaration of function 'sem_timedwait'
*** WARNING: renaming "_multiprocessing" since importing it failed: dlopen(build/lib.macosx-10.6-i386-2.7/_multiprocessing.so, 2): Symbol not found: _sem_timedwait
  Referenced from: /private/var/tmp/Python-2.7.1/build/lib.macosx-10.6-i386-2.7/_multiprocessing.so
  Expected in: flat namespace
 in /private/var/tmp/Python-2.7.1/build/lib.macosx-10.6-i386-2.7/_multiprocessing.so
ranlib libpython2.7.a
gcc -Wall -undefined dynamic_lookup -arch i386 -u _PyMac_Error -o python.exe \
                        Modules/python.o \
                        libpython2.7.a -ldl  -framework CoreFoundation     
building dbm using ndbm

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             gdbm               linuxaudiodev   
ossaudiodev        sunaudiodev                        
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Failed to build these modules:
_multiprocessing   spwd

assignee: ronaldoussoren
components: Macintosh
messages: 129573
nosy: dev66, ronaldoussoren
priority: normal
severity: normal
status: open
title: Failed to build _multiprocessing on Mac OS X
type: compile error
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list