You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to include pandas via the requirements in buildozer.spec file. The apk builds ok, but when I try to run it on my device, I get the error: ImportError: dlopen failed: cannot locate symbol "_ZTVSt12length_error" referenced by "/data/data/org.test.matplotlib_testapp/files/app/_python_bundle/site-packages/pandas/_libs/window/aggregations.so"...
The curious thing is that this is supposedly addressed in the build recipe, but I still get the same error when trying to import pandas in my main.py file.
buildozer.spec
This is what the requirements line looks like in the spec file
requirements = python3==3.7.5,kivy==2.0.0,hostpython3==3.7.9,numpy,pandas
Command:
buildozer android debug
Logs
ImportError: dlopen failed: cannot locate symbol "_ZTVSt12length_error" referenced by "/data/data/org.test.matplotlib_testapp/files/app/_python_bundle/site-packages/pandas/_libs/window/aggregations.so"..
Reacted by HACKER-BYTE-HUE, Evecimar Silva and Yash Khandelwal
It was working for a while, but using develop branch suddenly stopped working with the same dlopen failed issue. IDK why that would be. Everything else is the same
@Revoluti0n thanks its possible way but not desired one, as a lot of refactoring is needed in my current project. Is there any workaround using pandas?
For me, things worked fine on Android 10, Galaxy S10. On Android 11, Galaxy S21, I had the _ZTVSt12length_error. need_stl_shared=True was not enough. What did the trick is adding self.stl_lib_name to the following line in the pandas recipe:
env['LDFLAGS'] += f' -landroid -l{self.stl_lib_name}'
I still encounter issues for this, I tried to follow suggestions provided in this bug report comments but at the moment I cannot make my project work on android with pandas:
I'm talking about @yukhnovskiy, @mzakharocsc comments and reccomendation of @tshirtman to use develop branch of p4a, I was able to check the pandas recipe in develop contains already the instructions suggested, Anyway I've got this error when running on my phone:
08-16 15:30:26.767 22874 22921 I python : ImportError: C extension: dlopen failed: TLS symbol "_ZZN8gwp_asan15getThreadLocalsEvE6Locals" in dlopened "/data/user/0/net.magowiz.travel_lint/files/app/_python_bundle/site-packages/pandas/_libs/tslibs/conversion.so" referenced from "/data/user/0/net.magowiz.travel_lint/files/app/_python_bundle/site-packages/pandas/_libs/tslibs/conversion.so" using IE access model not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
I don't know if it is the same problem or a related one, I also pinned pandas version to 1.0.3 the one indicated by recipe, to be sure I was using a fixed one, here it is mine buildozer.spec file:
Hi @misl6,
I can confirm that now, after your fix, I used develop branch of p4a and pandas error goes away, thank you.
I can see now a module not found error but it is my fault since I forgot to put that module in buildozer.spec requirements :-)
Activity
tshirtman commentedon Feb 19, 2021
I just forked my lottie demo repository to add pandas in the requirements, the package built and run on my phone, displaying a DataFrame.
https://github.com/tshirtman/p4a_pandas_test/actions/runs/579782702
you can grab the apk there and look at the code and configuration in the repository if it helps.
RobertFlatt commentedon Feb 19, 2021
That comment in the recipe indicates
libandroid.sowas possibly not found.That lib is part of the NDK.
No idea why that would be.
tshirtman commentedon Feb 19, 2021
Apparently one needs to use p4a.branch=develop for pandas.
HACKER-BYTE-HUE commentedon Feb 21, 2021
😄
Revoluti0n commentedon Feb 27, 2021
I solved this using python lists to manage data instead of pandas module.. don't know if it's the best solution but its working now
tugsag commentedon Mar 2, 2021
Yep, using develop branch fixed the issues. Thank you!
tugsag commentedon Mar 2, 2021
It was working for a while, but using develop branch suddenly stopped working with the same dlopen failed issue. IDK why that would be. Everything else is the same
yukhnovskiy commentedon Jul 4, 2021
@tugsag, have you solved a problem? Having same when running apk file built with kivy on Android 11 Sasmung S10e
Revoluti0n commentedon Jul 4, 2021
@yukhnovskiy my app is working and stable so far using python native lists instead of pandas to manage data, same phone and also built with kivy
yukhnovskiy commentedon Jul 4, 2021
@Revoluti0n thanks its possible way but not desired one, as a lot of refactoring is needed in my current project. Is there any workaround using pandas?
yukhnovskiy commentedon Jul 4, 2021
btw here: https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/pandas/__init__.py
was some sollution, but seems it stopped working.
yukhnovskiy commentedon Jul 7, 2021
Changing in recipe.py "need_stl_shared = True" solved issue for me. And pandas works fine.
Revoluti0n commentedon Jul 7, 2021
@yukhnovskiy good job, thanks for sharing
mzakharocsc commentedon Jul 20, 2021
For me, things worked fine on Android 10, Galaxy S10. On Android 11, Galaxy S21, I had the
_ZTVSt12length_error.need_stl_shared=Truewas not enough. What did the trick is addingself.stl_lib_nameto the following line in the pandas recipe:tshirtman commentedon Jul 24, 2021
Feel free to open a pull request for the necessary changes :)
AndreMiras commentedon Jul 26, 2021
Fixed via #2478 thanks for the pull request 💪
Edit: note this is available in the
developbranchalessandrofesti commentedon Dec 7, 2021
I keep having issues with pandas:
Below my spec file
mp-007 commentedon Dec 7, 2021
I think the recipes is for pandas 1.0.3 (see the pull request)
alessandrofesti commentedon Dec 9, 2021
Thanks!
magowiz commentedon Aug 16, 2022
I still encounter issues for this, I tried to follow suggestions provided in this bug report comments but at the moment I cannot make my project work on android with pandas:
I'm talking about @yukhnovskiy, @mzakharocsc comments and reccomendation of @tshirtman to use develop branch of p4a, I was able to check the pandas recipe in develop contains already the instructions suggested, Anyway I've got this error when running on my phone:
I don't know if it is the same problem or a related one, I also pinned pandas version to 1.0.3 the one indicated by recipe, to be sure I was using a fixed one, here it is mine buildozer.spec file:
misl6 commentedon Aug 16, 2022
Hi @magowiz !
I've just merged a fix on
developthat may fix your issue. (Please be sure to do a clean build)Feel free to open a new issue if you still encounter any issues.
magowiz commentedon Aug 16, 2022
Hi @misl6,
I can confirm that now, after your fix, I used develop branch of p4a and pandas error goes away, thank you.
I can see now a module not found error but it is my fault since I forgot to put that module in buildozer.spec requirements :-)