Skip to content
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

Can not import this package on python 3.11 #24

Open
tayyebehsaeedi opened this issue May 11, 2023 · 5 comments
Open

Can not import this package on python 3.11 #24

tayyebehsaeedi opened this issue May 11, 2023 · 5 comments

Comments

@tayyebehsaeedi
Copy link

Hi everyone
When I want to import the Parivar package on Python 3.11, It can not be imported because of the 'Iterable' of the 'collections' package. Actually, the following code of the Parsivar package is not called:
try:
# Python <= 3.9
from collections import Iterable
except ImportError:
# Python > 3.9
from collections.abc import Iterable

How can I fix this problem?
I must mention that I install the Parsivar package by following the code:
pip install git+https://github.com/ICTRC/Parsivar

Looking forward to hearing from you
Best Regards
Tayyebeh Saeedi

@AmirMohamadBabaee
Copy link

Hi, First of all, thanks for your excellent repository. I faced the same issue in Python 3.10.

@Alirezab-2000
Copy link

I faced the same issue in python 3.10

@hdeldar
Copy link

hdeldar commented Jun 26, 2023

Hi. @tayyebehsaeedi, thanks for your solution. My problem was solved by changing
from collections import Iterable
with
from collections.abc import Iterable
in file
..\Python311\Lib\site-packages\parsivar\token_merger.py
which was installed with pip install parsiver
.

@translation-robot
Copy link

Thank you the modified import worked for me on python 3.11, but I had to upgrade nltk

pip install nltk --upgrade

Successfully installed nltk-3.8.1

@translation-robot
Copy link

translation-robot commented Dec 29, 2023

For python 3.11, setup.py should replace this line:

  install_requires=['nltk==3.6.6'],

by this line:
install_requires=['nltk==3.8.1'],

Also mentioned in this post, replace in file token_merger.py:

Python <= 3.9

from collections import Iterable

Python > 3.9

from collections.abc import Iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants