learningequality / kolibri-app

Kolibri app for Mac and Windows
MIT License
2 stars 10 forks source link

Build fails with error `NameError: name 'unicode' is not defined` #105

Closed rtibbles closed 2 years ago

rtibbles commented 2 years ago

Not clear if this is only happening for the develop branch of Kolibri, or whether this happens for 0.15.x as well.

Traceback:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/__main__.py", line 188, in <module>
    run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/__main__.py", line 178, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/__main__.py", line 59, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 934, in main
    build(specfile, distpath, workpath, clean_build)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 856, in build
    exec(code, spec_namespace)
  File "kolibri.spec", line 27, in <module>
    a = Analysis(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 3[48](https://github.com/learningequality/kolibri/actions/runs/3105721594/jobs/5031833685#step:13:49), in __init__
    self.hookspath += discover_hook_directories()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/isolated/_parent.py", line 269, in wrapped
    return call(function, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/isolated/_parent.py", line 238, in call
    return isolated.call(function, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/isolated/_parent.py", line 176, in call
    raise RuntimeError(f"Child process call to {function.__name__}() failed with:\n" + output)
RuntimeError: Child process call to discover_hook_directories() failed with:
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/isolated/_child.py", line [63](https://github.com/learningequality/kolibri/actions/runs/3105721594/jobs/5031833685#step:13:64), in run_next_command
    output = function(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 105, in discover_hook_directories
    import pkg_resources
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 23, in <module>
    import zipfile
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 7, in <module>
    import importlib.util
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
    from . import abc
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
    from typing import Protocol, runtime_checkable
  File "/Users/runner/work/kolibri/kolibri/kolibri/kolibri/dist/typing.py", line [78](https://github.com/learningequality/kolibri/actions/runs/3105721594/jobs/5031833685#step:13:79)2, in <module>
    AnyStr = TypeVar('AnyStr', bytes, unicode)
NameError: name 'unicode' is not defined
rtibbles commented 2 years ago

This appears to be caused by adding packages to Kolibri that depend on the scandir and typing backport modules. This should be a py2only module.