Skip to content

env must be a dict #2170

@bitinerant

Description

@bitinerant

Versions

  • Python: 3.8.2
  • OS: Ubuntu 20.04

Description

My buildozer android release command failed with env must be a dict, exactly as described in Askubuntu #1233200 and the answer proposed by Camden Senneff worked well for Likes_to_Program123 and for me.

This seems similar to bug #1080 but the diff is different.

Here is the diff that fixed the issue for me:

kivy@kivy-buildozer:~/bitburrow/.buildozer/android/platform/python-for-android$ git diff
diff --git a/pythonforandroid/build.py b/pythonforandroid/build.py
index 8f0ac40a..3642337a 100644
--- a/pythonforandroid/build.py
+++ b/pythonforandroid/build.py
@@ -788,13 +788,13 @@ def run_pymodules_install(ctx, modules, project_dir=None,
         info('Upgrade pip to latest version')
         shprint(sh.bash, '-c', (
             "source venv/bin/activate && pip install -U pip"
-        ), _env=copy.copy(base_env))
+        ), _env=dict(copy.copy(base_env)))
 
         # Install Cython in case modules need it to build:
         info('Install Cython in case one of the modules needs it to build')
         shprint(sh.bash, '-c', (
             "venv/bin/pip install Cython"
-        ), _env=copy.copy(base_env))
+        ), _env=dict(copy.copy(base_env)))
 
         # Get environment variables for build (with CC/compiler set):
         standard_recipe = CythonRecipe()
@@ -838,7 +838,7 @@ def run_pymodules_install(ctx, modules, project_dir=None,
                 "venv/bin/pip " +
                 "install -v --target '{0}' --no-deps -r requirements.txt"
             ).format(ctx.get_site_packages_dir().replace("'", "'\"'\"'")),
-                    _env=copy.copy(env))
+                    _env=dict(copy.copy(base_env)))
 
         # Afterwards, run setup.py if present:
         if project_dir is not None and (

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions