You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement the google api in chaquopy.
The following libraries in my python script are:
from google_auth_oauthlib.flow import Flow, InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload, MediaIoBaseDownload
from google.auth.transport.requests import Request
from oauth2client.service_account import ServiceAccountCredentials
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
The stack trace is:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myloginapp, PID: 16480
com.chaquo.python.PyException: AttributeError: module 'typing' has no attribute '_ClassVar'
at <python>.dataclasses._is_classvar(dataclasses.py:550)
at <python>.dataclasses._get_field(dataclasses.py:659)
at <python>.dataclasses.<listcomp>(dataclasses.py:800)
at <python>.dataclasses._process_class(dataclasses.py:800)
at <python>.dataclasses.wrap(dataclasses.py:950)
at <python>.dataclasses.dataclass(dataclasses.py:958)
at <python>.pkg_resources.extern.packaging._tokenizer.<module>(_tokenizer.py:10)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.pkg_resources.extern.packaging._parser.<module>(_parser.py:10)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.pkg_resources.extern.packaging.requirements.<module>(requirements.py:8)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.pkg_resources.<module>(__init__.py:93)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.googleapiclient.model.<module>(model.py:30)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.googleapiclient.http.<module>(http.py:64)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.googleapiclient.discovery.<module>(discovery.py:68)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.googleFolderSelect.<module>(googleFolderSelect.py:7)
at <python>.importlib._bootstrap._call_with_frames_removed(<frozen importlib._bootstrap>:219)
at <python>.importlib._bootstrap_external.exec_module(<frozen importlib._bootstrap_external>:843)
at <python>.java.android.importer.exec_module(.\java\android\importer.py:545)
at <python>.importlib._bootstrap._load_unlocked(<frozen importlib._bootstrap>:671)
at <python>.importlib._bootstrap._find_and_load_unlocked(<frozen importlib._bootstrap>:975)
at <python>.importlib._bootstrap._find_and_load(<frozen importlib._bootstrap>:991)
at <python>.importlib._bootstrap._gcd_import(<frozen importlib._bootstrap>:1014)
at <python>.importlib.import_module(__init__.py:127)
at <python>.chaquopy_java.Java_com_chaquo_python_Python_getModuleNative(chaquopy_java.pyx:154)
at com.chaquo.python.Python.getModuleNative(Native Method)
at com.chaquo.python.Python.getModule(Python.java:84)
at com.example.myloginapp.SecondActivity$3.onClick(SecondActivity.java:105)
at android.view.View.performClick(View.java:5653)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View$PerformClick.run(View.java:22461)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6138)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
The text was updated successfully, but these errors were encountered:
The first few Google results for this error indicate that it's caused by installing the backported dataclasses package, which is incompatible with Python 3.7 or newer:
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload, MediaIoBaseDownload
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
In my Gradle, the versions of these python libraries that give the error are:
Try removing your requirements one at a time, rebuilding your app, and looking at the build log, until dataclasses stops appearing in the log. Or if you have a lot more requirements than those you've shown, you can use a binary search.
Once you know which requirement depends on dataclasses, you should be able to upgrade it to a newer version that doesn't have that dependency.
I am trying to implement the google api in chaquopy.
The following libraries in my python script are:
The stack trace is:
The text was updated successfully, but these errors were encountered: