PaddlePaddle / Quantum

Other
567 stars 176 forks source link

ImportError: cannot import name 'State' from 'sre_parse' #35

Closed samanthaongyh closed 1 year ago

samanthaongyh commented 2 years ago

请问该怎么解决这个 error? image

wangzihe1996 commented 2 years ago

你看看你的Python版本,我这里是Python3.8,是可以运行的。 以及我发现你的程序是旧版的程序,但是你运行的环境是新版的,因为2.2.0版本更新是不兼容更新,所以可能会有些问题。

其实图片里的这行报错的import是写的有问题的,这个后续会修复。

skywalk163 commented 2 years ago

我这边试了下,确实python3.8是可以的,而AIStudio自带的python3.7,是不可以的。

请问在官方修复版本出来之前,有简单的代码修复解决方案吗?

juhonkang commented 2 years ago

Yes, I have the same problem, please fix it quickly

wangzihe1996 commented 2 years ago

其实只需要把container.py的21行的from sre_parse import State去掉即可。

wangzihe1996 commented 1 year ago

This bug has been fixed by the version v2.2.1.

DrTenma1998 commented 7 months ago

Update the exrex library: The issue may have been fixed in a newer version of exrex. Try updating the library with the following commands:

pip uninstall exrex pip install exrex