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
csv is included in the standard library, but i cannot load the module on android.
adb logcat says this:
I/python (20884): File "/home/enlightx/Development/Kivy/python-for-android/build/python-install/lib/python2.7/csv.py", line 8, in
I/python (20884): ImportError: No module named _csv
It's part of the modules that are blacklisted by default to make the shipping packages lighter, you can safely reactivate it by editing the blacklist.txt file of your python-for-android distribution.
There are 2 locations for blacklist.txt, one is inside .buildozer/android/platform/python-for-android/src/ and the other is in python-for-android/dist/distname, the first changes the blacklist for every compilation the other for a specific compilation.
So don't forget to remove it from BOTH. I accomplished that with the following lines in my makefile bash script (my app is called lanki):
# Create the .buildozer folder and download its subcomponents, including the blacklist.txt file we are about to modify
buildozer android update
# Remove the line containing csv so the csv module is installed, as per the warning on
# http://python-for-android.readthedocs.org/en/latest/usage/#step-2-package-your-application
# grep -v reverses the search, showing all lines except the one matching the pattern
cwd=$(pwd)
# INSTALL CSV module
# This requires removing _csv from the two blacklist files
# According to
# https://groups.google.com/forum/#!msg/kivy-users/mgisdssF39M/28vgOWfM0y0J
# There are 2 locations for blacklist.txt:
# - one is inside .buildozer/android/platform/python-for-android/src/ and
# - the other is in python-for-android/dist/distname
# the first changes the blacklist for every compilation;
# the second for a specific compilation.
cd .buildozer/android/platform/python-for-android/src/
cat blacklist.txt | grep -v "_csv" > blacklist.txt2
rm blacklist.txt
mv blacklist.txt2 blacklist.txt
cd $cwd
cd .buildozer/android/platform/python-for-android/dist/lanki/
cat blacklist.txt | grep -v "_csv" > blacklist.txt2
rm blacklist.txt
mv blacklist.txt2 blacklist.txt
cd $cwd
Activity
tshirtman commentedon Oct 8, 2012
It's part of the modules that are blacklisted by default to make the shipping packages lighter, you can safely reactivate it by editing the blacklist.txt file of your python-for-android distribution.
dcorio commentedon Oct 8, 2012
thanks!
MichaelCurrie commentedon Sep 26, 2015
Keep in mind from https://groups.google.com/forum/#!msg/kivy-users/mgisdssF39M/28vgOWfM0y0J that:
So don't forget to remove it from BOTH. I accomplished that with the following lines in my makefile bash script (my app is called lanki):