My application built with KivyMD crashes when start on Android, while it works properly when the .py file is run.
I looked online and there are many reports of this issue, but none of the solutions solved my problem (they helped me though).
I am currently using the following external modules specified in the requirements.txt file:
crayion.py, kivy, kivymd, buildozer, pytest
crayion.py has only requests as its own dependency
Using a little bit of trial and error and adb debug on the crash, I ended up adding this requirement line in the buildozer.spec file (whenever the log told me that one of these modules was missing, I added it):
requirements = python3,kivy==master,craiyon.py,kivymd==1.1.1,docutils,sdl2_ttf==2.0.15,pil,requests,urllib3,idna,chardet,Image,pysocks,aiohttp,multidict,attrs,certifi,pygments,pypiwin32,yarl,async-timeout,charset-normalizer,cchardet
At this point the error I receive is not a missing module error, but this:
02-13 18:40:24.128 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/aiohttp/client_reqrep.py", line 70, in <module>
02-13 18:40:24.129 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/cchardet/__init__.py", line 1, in <module>
02-13 18:40:24.129 2022 17111 I python : ImportError: dlopen failed: "/data/data/com.aidreamvision.dreamvision/files/app/_python_bundle/site-packages/cchardet/_cchardet.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
02-13 18:40:24.129 2022 17111 I python :
02-13 18:40:24.129 2022 17111 I python : During handling of the above exception, another exception occurred:
02-13 18:40:24.129 2022 17111 I python :
02-13 18:40:24.129 2022 17111 I python : Traceback (most recent call last):
02-13 18:40:24.129 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/app/main.py", line 9, in <module>
02-13 18:40:24.129 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/craiyon/__init__.py", line 1, in <module>
02-13 18:40:24.129 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/craiyon/craiyon.py", line 2, in <module>
02-13 18:40:24.130 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/aiohttp/__init__.py", line 6, in <module>
02-13 18:40:24.130 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/aiohttp/client.py", line 59, in <module>
02-13 18:40:24.130 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/aiohttp/client_reqrep.py", line 72, in <module>
02-13 18:40:24.130 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/charset_normalizer/__init__.py", line 24, in <module>
02-13 18:40:24.130 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/charset_normalizer/api.py", line 5, in <module>
02-13 18:40:24.131 2022 17111 I python : File "/github/workspace/src/dreamvision/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/dreamvision/arm64-v8a/charset_normalizer/cd.py", line 9, in <module>
02-13 18:40:24.131 2022 17111 I python : ImportError: dlopen failed: "/data/data/com.aidreamvision.dreamvision/files/app/_python_bundle/site-packages/charset_normalizer/md.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
where to me it sounds as if the modules I am trying to use are not built for the right architecture, from this line: ImportError: dlopen failed: "/data/data/com.aidreamvision.dreamvision/files/app/_python_bundle/site-packages/charset_normalizer/md.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
any advice on how to solve this?
I have been trying for days and tried to apply actions from hundreds of similar emails.
For more context I can provide the link to the github repository where I am working, but I don't know if this is allowed and helpful.
Related
Whenever I run the following code:
'import tensorflow'
I get the following error:
'
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import tensorflow
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\__init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
self_check.preload_check()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\platform\self_check.py", line 54, in preload_check
raise ImportError(
ImportError: Could not find the DLL(s) 'msvcp140.dll or msvcp140_1.dll'. TensorFlow requires that these DLLs be installed in a directory that is named in your %PATH% environment variable. You may install these DLLs by downloading "Microsoft C++ Redistributable for Visual Studio 2015, 2017 and 2019" for your platform from this URL: https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads
'
You issue can be resolved once you installed the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, and 2019. Starting with the TensorFlow 2.1.0 version, the msvcp140_1.dll file is required.
For more details you can refer here.
I had installed Python manually by using below comamnd-
#cd Python-3.7.4
#./configure --enable-optimizations
#make altinstall
and later NumPy and Pandas libraries manually as below -
#python3.7 setup.py install
ERROR -
>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/mycom/data/support/pandas-1.0.3/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/opt/mycom/data/support/pandas-1.0.3/pandas/core/api.py", line 29, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "/opt/mycom/data/support/pandas-1.0.3/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy
File "/opt/mycom/data/support/pandas-1.0.3/pandas/core/groupby/generic.py", line 60, in <module>
from pandas.core.frame import DataFrame
File "/opt/mycom/data/support/pandas-1.0.3/pandas/core/frame.py", line 104, in <module>
from pandas.core.generic import NDFrame, _shared_docs
File "/opt/mycom/data/support/pandas-1.0.3/pandas/core/generic.py", line 99, in <module>
from pandas.io.formats import format as fmt
File "/opt/mycom/data/support/pandas-1.0.3/pandas/io/formats/format.py", line 75, in <module>
from pandas.io.common import stringify_path
File "/opt/mycom/data/support/pandas-1.0.3/pandas/io/common.py", line 3, in <module>
import bz2
File "/usr/local/lib/python3.7/bz2.py", line 19, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
Then I tried workaround around as mentioned below but it didn't help
missing python bz2 module
Below are OS details-
Red Hat Enterprise Linux Server release 7.3 (Maipo)
Linux NVMBD1CJH190V03 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
I'm getting the following error when running import P4:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python35\lib\site-packages\P4.py", line 410, in <module>
import P4API
ImportError: DLL load failed: The specified module could not be found.
OS: Win 7 64 bit
Python: 3.5.1
P4Python: https://pypi.python.org/pypi/P4Python : p4python-2015.2.1348262-cp35-none-win_amd64.whl (md5)
I looked online but couldn't find something that would help.
I installed PyCrypto on python 64-bit version on windows 10 64-bit version
when i type :
from Crypto.Hash import SHA512
everything is working fine and i can calculate the hash
but when i type: from Crypto.PublicKey import RSA,or any Crypto.PublicKey library i am getting errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\users\ali\appdata\local\temp\easy_install-1inbe0\pycrypto-2.6.1-py2.7-win-amd64.egg.tmp\Crypto\PublicKey\RSA.py", line 78, in <module>
File "c:\users\ali\appdata\local\temp\easy_install-1inbe0\pycrypto-2.6.1-py2.7-win-amd64.egg.tmp\Crypto\Random\__init__.py", line 28, in <module>
File "c:\users\ali\appdata\local\temp\easy_install-1inbe0\pycrypto-2.6.1-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\__init__.py", line 34, in <module>
File "c:\users\ali\appdata\local\temp\easy_install-1inbe0\pycrypto-2.6.1-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\nt.py", line 28, in <module>
File "c:\users\ali\appdata\local\temp\easy_install-1inbe0\pycrypto-2.6.1-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 7, in <module>
File "c:\users\ali\appdata\local\temp\easy_install-1inbe0\pycrypto-2.6.1-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 6, in __bootstrap__
ImportError: DLL load failed: %1 is not a valid Win32 application.
I am new to installing and using python packages and libraries.
here you can see that the library is included correctly
can someone help me with this error please?
I have a well built project in Python 2.7 using Windows7. It works well before today, and I just running it without modifying it for weeks.
Today, when I open it and try to run it, it gives me some ImportError which says numpy and wx package are not valid Win32 applications. So I re-install these packages (32-bit versions). Then it is executable.
However, the thing is getting even weird, it keeps giving memory error. I was watching the task manager, and can obviously see that when the error pops, the memory is just half-full.
May I know how I can make it works properly?
Thanks.
EDIT:
I've tried to install 64 bit version of Numpy to replace the 32 bit one. However, the memory error pops again.
EDIT2:
Following is the trace back numpy import error:
Traceback (most recent call last):
File "C:\Users\user\My Documents\Aptana Studio 3 Workspace\State Machine Version 4.0\main.py", line 9, in <module>
import numpy as np
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 154, in <module>
import add_newdocs
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
from type_check import *
File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 5, in <module>
import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.
EDIT3:
I've installed 32-bit numpy again. Now the memory error is back. The trace back is as follows:
Traceback (most recent call last):
File "C:\Users\user\My Documents\Aptana Studio 3 Workspace\State Machine Version 4.0\main.py", line 55, in <module>
portfolio = Portfolio(portfolio_path, recovery_tree_path, tree_rule_path, output_path, history_length, horizon, simulation_number, simulation_mode, adjustment_mode, adjustment_node_list, segmentation_flag, segmentation_variable)
File "C:\Users\user\My Documents\Aptana Studio 3 Workspace\State Machine Version 4.0\PortfolioClass.py", line 131, in __init__
self.LoadFromCSV()
File "C:\Users\user\My Documents\Aptana Studio 3 Workspace\State Machine Version 4.0\PortfolioClass.py", line 139, in LoadFromCSV
self.load_accounts()
File "C:\Users\user\My Documents\Aptana Studio 3 Workspace\State Machine Version 4.0\PortfolioClass.py", line 217, in load_accounts
acc = Account(account_id, vintage, sale_balance, LPAPerc2, Con_Score_Pre, Predicted_Contact_Type_ITC, thresholds, cost)
File "C:\Users\user\My Documents\Aptana Studio 3 Workspace\State Machine Version 4.0\AccountClass.py", line 153, in __init__
self._account_monthly_revenues = np.zeros((self._parent._simulation_number, self._parent._horizon))
MemoryError