Skip to content
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

csv module #54

Closed
dcorio opened this issue Oct 8, 2012 · 3 comments
Closed

csv module #54

dcorio opened this issue Oct 8, 2012 · 3 comments

Comments

@dcorio
Copy link

dcorio commented Oct 8, 2012

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

@tshirtman
Copy link
Member

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
Copy link
Author

dcorio commented Oct 8, 2012

thanks!

@dcorio dcorio closed this as completed Oct 8, 2012
@MichaelCurrie
Copy link

Keep in mind from https://groups.google.com/forum/#!msg/kivy-users/mgisdssF39M/28vgOWfM0y0J that:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants