-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'typing' has no attribute '_ClassVar' #8638
Comments
This is weird! Looking at the stacktrace, I have a few questions:
It seems far-fetched but if that's the case, it might be possible that this file is interfering with the |
It seems related to an incompatibility of python > 3.6 with package dataclasses, as explained here:
|
Yes, but we only install |
I encountered the same problem with the following setup:
Local execution works fine, but when running the code on Google App Engine (Standard Environment), it fails with error Stacktrace:
|
Any solution? |
Could one of you post the result of Thank you! |
I solved this problem by removing |
I have solved this problem by downgrading to Python version: 3.6 Thanks @attardi |
note that Until then @thesby's solution is the easiest one.
|
I don't know why, but for me changing the version of Python worked (from 3.9.12 to 3.9.5.) |
In my case
in the location where |
Dependency to -'dataclasses'
+'dataclasses; python_version < "3.7"' or use |
I met the same error without having dataclasses installed in my environment (python 3.9). I installed dataclasses and uninstalled it again - from this point on the error disappeared. |
There is [incompatibility](huggingface/transformers#8638) between python > 3.6 and package `dataclasses`. This error was happening after my compilations: `AttributeError: module 'typing' has no attribute '_ClassVar'` The fix is removing `dataclasses` from `python_depends`. I also updated the pydantic version to the newest release `1.10.4`, it can be checked [here](https://github.com/pydantic/pydantic/releases) and its url. I already compiled my app after applying these changes, and the compilation is working successfully again.
* Update `pydantic` recipe There is [incompatibility](huggingface/transformers#8638) between python > 3.6 and package `dataclasses`. This error was happening after my compilations: `AttributeError: module 'typing' has no attribute '_ClassVar'` The fix is removing `dataclasses` from `python_depends`. I also updated the pydantic version to the newest release `1.10.4`, it can be checked [here](https://github.com/pydantic/pydantic/releases) and its url. I already compiled my app after applying these changes, and the compilation is working successfully again. * Restrict sh version to sh>=1.10, <2.0 (#2746) keep sh version under 2.0 as default behaviour was switched * Update CHANGELOG.md and update version to 2023.02.10 --------- Co-authored-by: Filipe Marchesini <filipe.marchesini@gmail.com> Co-authored-by: Andre Miras <AndreMiras@users.noreply.github.com> Co-authored-by: HyTurtle <81598434+HyTurtle@users.noreply.github.com>
There is [incompatibility](huggingface/transformers#8638) between python > 3.6 and package `dataclasses`. This error was happening after my compilations: `AttributeError: module 'typing' has no attribute '_ClassVar'` The fix is removing `dataclasses` from `python_depends`. I also updated the pydantic version to the newest release `1.10.4`, it can be checked [here](https://github.com/pydantic/pydantic/releases) and its url. I already compiled my app after applying these changes, and the compilation is working successfully again.
Environment info
transformers
version: 3.5.1Who can help @sgugger .... @LysandreJik ... mb?
Information
Model I am using: Distilbert
The problem arises when using:
Just this:
The tasks I am working on is:
I am using default Distilbert for my flask API
To reproduce
Steps to reproduce the behavior:
That's a big part of the question. It works just fine on my local machine, but gives this error when run on my AWS server.
#This is all the code that I have. Here is the full error that I get:
The text was updated successfully, but these errors were encountered: