chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
762 stars 130 forks source link

Caused by: com.chaquo.python.PyException: AttributeError: module 'typing' has no attribute '_ClassVar' #329

Closed vikasgola closed 4 years ago

vikasgola commented 4 years ago

configurations:

python {
            buildPython "/usr/bin/python3.8"
            pip {
                install "gltflib"
                install "numpy-stl"
            }
        }

Other: it seems chaquo is internally using typing and dataclasses module which is causing this. I also tried using old version of python3 like python3.5, python3.6, python3.7 as suggested in stackoverflow ans. None works.

But then I look at Build logs which indicated that chaquo is using dataclasses and typing which is probably cause of error.

Executing tasks: [:app:assembleDebug] in project ...

> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for armeabi-v7a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0
Collecting gltflib
  Using cached https://files.pythonhosted.org/packages/29/9f/67c6b7da97dd67927f6d341832f8bd05a6c08da037fb2a4c266e796746e7/gltflib-1.0.5-py3-none-any.whl
Collecting numpy-stl
Collecting dataclasses-json>=0.2.2 (from gltflib)
  Using cached https://files.pythonhosted.org/packages/0e/7f/0fe2caf46bcf3c24b3eff464b52513ad22b5779f1ba7e5324795646a0679/dataclasses_json-0.5.1-py3-none-any.whl
Collecting dataclasses>=0.6 (from gltflib)
  Using cached https://files.pythonhosted.org/packages/26/2f/1095cdc2868052dd1e64520f7c0d5c8c550ad297e944e641dbf1ffbb9a5d/dataclasses-0.6-py3-none-any.whl
Collecting python-utils>=1.6.2 (from numpy-stl)
  Using cached https://files.pythonhosted.org/packages/d9/ff/623dfa533f3277199957229f053fdb2c73a9c18048680e1899c9a5c95e6b/python_utils-2.4.0-py2.py3-none-any.whl
Collecting numpy (from numpy-stl)
  Using version 1.17.4 (newest version is 1.19.0, but Chaquopy prefers native wheels)
  Using cached https://chaquo.com/pypi-7.0/numpy/numpy-1.17.4-3-cp38-cp38-android_16_armeabi_v7a.whl
Collecting typing-inspect>=0.4.0 (from dataclasses-json>=0.2.2->gltflib)
  Using cached https://files.pythonhosted.org/packages/42/1c/66402db44184904a2f14722d317a4da0b5c8c78acfc3faf74362566635c5/typing_inspect-0.6.0-py3-none-any.whl
Collecting marshmallow-enum<2.0.0,>=1.5.1 (from dataclasses-json>=0.2.2->gltflib)
  Using cached https://files.pythonhosted.org/packages/c6/59/ef3a3dc499be447098d4a89399beb869f813fee1b5a57d5d79dee2c1bf51/marshmallow_enum-1.5.1-py2.py3-none-any.whl
Collecting marshmallow<4.0.0,>=3.3.0 (from dataclasses-json>=0.2.2->gltflib)
  Using cached https://files.pythonhosted.org/packages/8e/4d/1c64381398d25bc46250373dbeec89713f06e23eba8531c9eccd4e671a8a/marshmallow-3.6.1-py2.py3-none-any.whl
Collecting stringcase<2.0.0,==1.2.0 (from dataclasses-json>=0.2.2->gltflib)
Collecting six (from python-utils>=1.6.2->numpy-stl)
  Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting chaquopy-openblas>=0.2.20 (from numpy->numpy-stl)
  Using cached https://chaquo.com/pypi-7.0/chaquopy-openblas/chaquopy_openblas-0.2.20-5-py3-none-android_16_armeabi_v7a.whl
Collecting mypy-extensions>=0.3.0 (from typing-inspect>=0.4.0->dataclasses-json>=0.2.2->gltflib)
  Using cached https://files.pythonhosted.org/packages/5c/eb/975c7c080f3223a5cdaff09612f3a5221e4ba534f7039db34c35d95fa6a5/mypy_extensions-0.4.3-py2.py3-none-any.whl
Collecting typing-extensions>=3.7.4 (from typing-inspect>=0.4.0->dataclasses-json>=0.2.2->gltflib)
  Using cached https://files.pythonhosted.org/packages/0c/0e/3f026d0645d699e7320b59952146d56ad7c374e9cd72cd16e7c74e657a0f/typing_extensions-3.7.4.2-py3-none-any.whl
Collecting chaquopy-libgfortran>=4.9 (from chaquopy-openblas>=0.2.20->numpy->numpy-stl)
  Using cached https://chaquo.com/pypi-7.0/chaquopy-libgfortran/chaquopy_libgfortran-4.9-0-py3-none-android_16_armeabi_v7a.whl
Installing collected packages: mypy-extensions, typing-extensions, typing-inspect, marshmallow, marshmallow-enum, stringcase, dataclasses-json, dataclasses, gltflib, six, python-utils, chaquopy-libgfortran, chaquopy-openblas, numpy, numpy-stl
Successfully installed chaquopy-libgfortran-4.9 chaquopy-openblas-0.2.20 dataclasses-0.6 dataclasses-json-0.5.1 gltflib-1.0.5 marshmallow-3.6.1 marshmallow-enum-1.5.1 mypy-extensions-0.4.3 numpy-1.17.4 numpy-stl-2.11.2 python-utils-2.4.0 six-1.15.0 stringcase-1.2.0 typing-extensions-3.7.4.2 typing-inspect-0.6.0
Chaquopy: Installing for x86
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0
Collecting chaquopy-libgfortran==4.9
  Using cached https://chaquo.com/pypi-7.0/chaquopy-libgfortran/chaquopy_libgfortran-4.9-0-py3-none-android_16_x86.whl
Collecting chaquopy-openblas==0.2.20
  Using cached https://chaquo.com/pypi-7.0/chaquopy-openblas/chaquopy_openblas-0.2.20-5-py3-none-android_16_x86.whl
Collecting numpy==1.17.4
  Using cached https://chaquo.com/pypi-7.0/numpy/numpy-1.17.4-3-cp38-cp38-android_16_x86.whl
Installing collected packages: chaquopy-libgfortran, chaquopy-openblas, numpy
Successfully installed chaquopy-libgfortran-4.9 chaquopy-openblas-0.2.20 numpy-1.17.4

> Task :app:mergeDebugPythonSources
> Task :app:generateDebugPythonProxies
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileDebugSources UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:generateDebugPythonAppAssets
> Task :app:generateDebugPythonLicenseAssets UP-TO-DATE
> Task :app:generateDebugPythonMiscAssets UP-TO-DATE

References: https://stackoverflow.com/questions/55833509/attributeerror-type-object-callable-has-no-attribute-abc-registry https://github.com/RTIInternational/gobbli/issues/10

mhsmith commented 4 years ago

Please post the full exception trace, and the section of your code which triggers it.

mhsmith commented 4 years ago

If this is still a problem, please reopen the issue and provide the requested information.