-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: dlopen failed: cannot locate symbol "_ZTVSt9bad_alloc" #2903
Comments
This looks like it is the same issue as #2675. It looks like matplotlib needs to have |
Hi, thank you for your help! Could you specify which file I need to change? at what location? |
If you are installed in a virtual environment, look in
with the other global variables in the recipe class. If that fixes your problem, please consider making a pull request so others can benefit from it. |
Actually my suggestion might not work at all, since matplotlib is a C++ recipe, and it should be including the library already |
Read the last paragraph here https://github.com/Android-for-Python/Android-for-Python-Users#install The error reported is (failing to report) a memory usage error. |
Yes, this one solved my problem I think. I changed the recipe.py file with "need_stl_shared=True". I also added this in the init.py file. I can see the canvas now after opening the app, so I believe the matplotlib dependency's problem is solved. |
were to write this need_stl_shared=True in init.py? just anywere? |
this would be a class variable, not instance variable of one of the recipes. It is already implied by this line:
Since it is derived from a class setting that variable: python-for-android/pythonforandroid/recipe.py Line 1017 in 0df46c8
So make sure if matplotlib is in your buildozer.spec, this should be taken care of. If you are not using matplotlib, then you need to find the package failing to set this flag. |
Thanks for the reply; it's well appreciated. Which branch do I need to use? I am currently using the 'develop' branch from my fork in Kivy. |
if you are using matplotlib, this should all just work |
At some time and using other branches such as master, develop, release-2022.12.20 the Import error persist: Traceback (most recent call last): In my buildozer: (list) Source files to include (let empty to include all the files)source.include_exts = py,png,jpg,kv,atlas,mp3,db,xlsx (list) Application requirementsrequirements = python3==3.9.18,hostpython3==3.9.18,kivy,pillow==9.5.0,requests,flask,xlsxwriter,statistics,,kivy.garden,cython,pyparsing,pygments,matplotlib change the major version of python used by the apposx.python_version = 3.9.18 Kivy version to useosx.kivy_version = 2.1.0 (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy)p4a.fork = josh140520 (str) python-for-android branch to use, defaults to masterp4a.branch = master My fork for recipe.py: https://github.com/josh140520/python-for-android/blob/master/pythonforandroid/recipe.py The build is success, but the apk crash when I open in phone |
Please take this discussion to the support channels, not a closed bug report. |
Checklist
p4a.branch = develop
)Versions
Description
I have trouble importing matplotlib when running an app on my phone
buildozer.spec
Command:
Spec file:
Logs
The text was updated successfully, but these errors were encountered: