I have a virtualenv setup as to not pollute my development box.
When I try running buildozer android debug, I get a failure:
$ buildozer --version
# Check configuration tokens
Buildozer 0.33
$ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /Users/waboring/devel/android/.venv/bin/cython
# Search for Java compiler (javac)
# -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac
# Search for Java keytool (keytool)
# -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool
# Install platform
# Run 'pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10" "jinja2" "six"'
# Cwd None
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
# Command failed: pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10" "jinja2" "six"
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
Unfortunately, buildozer also use virtualenv to prevent pollution and control extraction of files for the target. If you have a way to make it work, please share, otherwise it's unlikely to changes.
You may try conda instead :)
i think we could just call the python in the virtualenv we create every time necessary (./venv/bin/python), instead of activating the new virtualenv, this way we could work even inside an activated virtualenv, and could decide to install with --user only if there is no current virtualenv, or give the user a way to decide if --user is to be used.
Being able to toggle the inclusion--user flag in buildozer.spec could be one way of solving the problem.
Any solution on this? I'm having the same issue
@kowsar89 The above posts suggest a solution you can try, but I don't think any such change has been committed to python-for-android.
@inclement I'm not sure which post you're refereeing, could you be more specific?
@kowsar89 tshirtman's post.
@inclement Did anybody actually tried that solution? Because for me this doesn't work. I tried the following command as suggested:
./venv/bin/python buildozer android debug
And it gives following error:
./venv/bin/python: can't open file 'buildozer': [Errno 2] No such file or directory
Could you tell me where I'm wrong? Or is there any other solution? Thanks
@kowsar89 I don't think that's what tshirtman meant, rather that python-for-android's internal calls to python could call the local virtualenv python. To do this, you would need to read the source, understand what it's doing, and make the change. It probably wouldn't be that hard, but it's not a completely trivial change either.
Other than that, I (or someone else) will probably look at this eventually, but it isn't a high priority right now compared to several other things we're working through.
@kowsar89 Hi,
You proposed almost the same (bad) solution I already propose (see PR). But tshirtman suggest something clever.
@maltouzes Why do you think it's a bad solution anyway? What's the worst thing can happen? I didn't send a pull request because I noticed you have almost same pull request already
@kowsar89 My Mistake, This solution works and I think this is a good workaround.
Most helpful comment
i think we could just call the python in the virtualenv we create every time necessary (./venv/bin/python), instead of activating the new virtualenv, this way we could work even inside an activated virtualenv, and could decide to install with --user only if there is no current virtualenv, or give the user a way to decide if --user is to be used.