[Python-Dev] Import Fails in setup.py On Android

Cyd Haselton chaselton at gmail.com
Tue Feb 3 14:48:34 CET 2015


It's not very helpful, but here it us if you want to look at it.  I added the INFO/ALERT statements in setup.py for troubleshooting purposes.

INFO: removing statically built modules
INFO: Parsing Modules/Setup and Setup.local
INFO: Getting env var to pass to setup.py
INFO: Building remaining exts
ALERT: building extension "array" None
building 'array' extension
gcc --sysroot=/usr/gcc-4.9.2/sysroot -fPIC -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -mandroid -mbionic -fno-builtin-sin -fno-builtin-cos -mandroid -mbionic -fno-builtin-sin -fno-builtin-cos -Werror=declaration-after-statement -I./Include -I. -IInclude -I/usr/gcc-4.9.2/sysroot/usr/include -I/bld/python/Python-3.4.2/Include -I/bld/python/Python-3.4.2 -c /bld/python/Python-3.4.2/Modules/arraymodule.c -o build/temp.linux-armv7l-3.4/bld/python/Python-3.4.2/Modules/arraymodule.o
gcc --sysroot=/usr/gcc-4.9.2/sysroot -shared -Wl,--dynamic-linker=/system/bin/linker -Wl,--sysroot=/usr/gcc-4.9.2/sysroot -Wl,--dynamic-linker=/system/bin/linker -Wl,--sysroot=/usr/gcc-4.9.2/sysroot -L/usr/local/lib -Wl,--dynamic-linker=/system/bin/linker -Wl,--sysroot=/usr/gcc-4.9.2/sysroot -L/usr/local/lib -mandroid -mbionic -fno-builtin-sin -fno-builtin-cos build/temp.linux-armv7l-3.4/bld/python/Python-3.4.2/Modules/arraymodule.o -L. -L/usr/local/lib -L/usr/gcc-4.9.2/sysroot/usr/lib -lc -ldl -lm -lpython3.4m -o build/lib.linux-armv7l-3.4/array.cpython-34m.so
INFO: building "array" complete None
ALERT: importing built module "array" None
fakechroot: dlopen: undefined symbol: dlopen

On February 2, 2015 3:32:38 PM CST, Ryan Gonzalez <rymg19 at gmail.com> wrote:
>Unfortunately, I have no idea. You might want to ask someone who's more
>familiar with the Python source than I am.
>
>What exactly appears? Does it say anything about the source of the
>error?
>
>On Mon, Feb 2, 2015 at 3:24 PM, Cyd Haselton <chaselton at gmail.com>
>wrote:
>
>> No traceback unfortunately...the fakechroot in the environment throws
>the
>> error and setup.py fails.
>>
>> I'll roll back that change...any idea where I could find info about
>the
>> original method?
>>
>>
>> On February 2, 2015 3:17:54 PM CST, Ryan Gonzalez <rymg19 at gmail.com>
>> wrote:
>>>
>>> In reality, things just got broken even more. I don't know when that
>>> patch was created, but it's now very out of date:
>importlib._bootstrap has
>>> no load function. That's what the error you're getting is telling
>you.
>>> Since it isn't getting to load anything, the issue seems "solved".
>Not
>>> really.
>>>
>>> What's the full traceback for the undefined reference exception?
>>>
>>> On Mon, Feb 2, 2015 at 2:04 PM, Cyd Haselton <chaselton at gmail.com>
>wrote:
>>>
>>>> Update: While waiting for replies I made the change referenced
>here:
>>>>
>https://bugs.python.org/review/5309/diff2/12811:12826/setup.py?context=3&column_width=80
>>>>
>>>> specifically changing
>>>> importlib. _bootstrap._SpecMethods(spec).load()
>>>> to
>>>> importlib._bootstrap.load(spec)
>>>>
>>>> I no longer get a terminating 'undefined reference to dlopen'
>error, but
>>>> I do get 'importing extensions failed' errors for each
>extension...like
>>>> this:
>>>>
>>>> *** WARNING: importing extension "_pickle" failed with <class
>>>> 'AttributeError'>: 'module' object has no attribute 'load'
>>>>
>>>>
>>>> On February 2, 2015 1:36:29 PM CST, Cyd Haselton
><chaselton at gmail.com>
>>>> wrote:
>>>>>
>>>>> After fixing a segfault issue (many thanks Ryan) I'm back to the
>same
>>>>> issue I was having with Python 2.7.8; the newly built python
>throws an
>>>>> undefined reference to dlopen when running setup.py...specifically
>>>>> when importing just-built extensions
>>>>>
>>>>> I've managed to narrow the problem down to the following line:
>>>>>
>>>>> importlib._bootstrap._SpecMethods(spec).load()
>>>>>
>>>>> Googling this brings up a few hits from bugs.python.org and not
>much
>>>>> else. I'm new to Python; any ideas what this does...or where I can
>read up
>>>>> on it for troubleshooting purposes?
>>>>>
>>>>
>>>> --
>>>> Sent from my Android device with K-9 Mail. Please excuse my
>brevity.
>>>>
>>>> _______________________________________________
>>>> Python-Dev mailing list
>>>> Python-Dev at python.org
>>>> https://mail.python.org/mailman/listinfo/python-dev
>>>> Unsubscribe:
>>>>
>https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com
>>>>
>>>>
>>>
>>>
>>> --
>>> Ryan
>>> If anybody ever asks me why I prefer C++ to C, my answer will be
>simple:
>>> "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that
>was
>>> nul-terminated."
>>> Personal reality distortion fields are immune to contradictory
>evidence.
>>> - srean
>>> Check out my website: http://kirbyfan64.github.io/
>>>
>>
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>
>
>
>
>-- 
>Ryan
>If anybody ever asks me why I prefer C++ to C, my answer will be
>simple:
>"It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that
>was
>nul-terminated."
>Personal reality distortion fields are immune to contradictory
>evidence. -
>srean
>Check out my website: http://kirbyfan64.github.io/

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150203/dae953b6/attachment-0001.html>


More information about the Python-Dev mailing list