kivy / kivy/python-for-android

Enhancement request: add documentation that your venv must not be in the project folder

Open
#2,848 1 comment 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
Python
Stars
8.9k
Forks
2k
Avg merge
12h 20m
Merged PRs (30d)
9

Description

I had encountered a mysterious issue where my project would appear to build cleanly, but python packages would sometimes go missing while trying to run the app.

Specifically, the app would crash during launch and any number of ModuleNotFoundErrors would appear in the logcat.
E.g. `ModuleNotFoundError: No module named 'paramiko'`

This behavior only appeared when certain packages were added, which made it more confusing. Using just python, kivy, and numpy, for example, caused no problems. (Might be related to things with recipes? Hard to tell)

This happened even when the various suggestions in the [troubleshooting guide](https://github.com/Android-for-Python/Android-for-Python-Users#non-deterministic-behavior) were followed, such as completely wiping the build and starting over, explicitly adding the full dependency tree(s) to the .spec requirements, ensuring nothing would cause non-deterministic behavior, etc.

What finally solved the issue was the realization that having my virtual environment folder **within** the project folder caused some kind of interference with the process (even though it was supposedly being ignored via the `source.exclude_dirs` parameter in the .spec file) .

### Summary
Please add documentation that including your virtual environment folder within your project's folder (where it will be seen by buildozer/p4a) can/will prevent the app from running even if it builds without obvious issues.

Contributor guide

Open the contributing guide

Research direction

Start with the linked troubleshooting guide and inspect the repository's documentation structure for the appropriate placement. Done means the documentation clearly warns that a virtual environment inside the project directory can interfere with buildozer/python-for-android, and explains where to keep it instead.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.