cannot import name 'Sequence' from 'collections'
时间: 2023-09-01 15:07:14 浏览: 329
sqlserver实现oracle的sequence方法
This error message usually occurs when trying to import the `Sequence` class from the `collections` module in Python 3.8 or earlier versions, where the `Sequence` class was not yet defined. The `Sequence` class was only introduced in Python 3.9.
If you're using Python 3.8 or earlier and need to use the `Sequence` class, you can try installing the `typing` module and importing `Sequence` from there:
```
from typing import Sequence
```
Alternatively, you can consider upgrading to Python 3.9 or later to use the `Sequence` class directly.
阅读全文