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

Fix Python 3.10 compatibility #3

Closed
emso-c opened this issue Oct 29, 2022 · 6 comments
Closed

Fix Python 3.10 compatibility #3

emso-c opened this issue Oct 29, 2022 · 6 comments

Comments

@emso-c
Copy link

emso-c commented Oct 29, 2022

install_requires in setup.py suggests that the package works with python_version < "3.8" and python_version >= "3.8" but the package is not compatible with Python 3.10 due to dependency cython_hunspell that uses cacheman package.

The problem is that in Python 3.10, MutableMapping moved from collections to collections.abc.

You can see that MutableMapping is still being imported from collections in this file.

As far as I can see said packages are not maintained properly. So maybe migrating away from them would be a solution. For the time being, the only solution other than fixing the error by hand is downgrading the Python version, which is not feasible in the long run IMHO.


To Reproduce:

Install and import the package

from vnlp import DependencyParser

Expected Result:

Package working properly.

Actual Result:

Error message saying ImportError: cannot import name 'MutableMapping' from 'collections'

Environment:

Python 3.10

@meliksahturker
Copy link
Collaborator

@emso-c python_version arguments in setup.py exist to resolve a conflict between tensorflow and numpy versions that existed in python <3.8.
The pypi page shows the supported Python versions.

Having said that, you are correct. We currently do not support 3.10 because of cyhunspell which is used for spelling correction. However the error I receive on 3.10 comes from cyhunspell not being installed, rather than your error so I assume you somehow managed to install cyhunspell on 3.10.

There was already a long-term plan to improve spelling correction and perhaps bypass hunspell algorithm completely.
We will look into a replacement that supports >=3.10 for a short-term solution.

Thanks for bringing this up.
I will keep the issue open until we resolve this.

@emso-c
Copy link
Author

emso-c commented Oct 29, 2022

@meliksahturker Thanks for your response. And yes, as you said I've resolved the issue by following these steps. The current issue occured after the installation.

Kolay gelsin :)

@meliksahturker
Copy link
Collaborator

@emso-c Moreover: There are open issues related to 3.10 and conda on cython hunspell github.
MSeal/cython_hunspell#27 (comment)
MSeal/cython_hunspell#36

both of which indicate MSeal is not in active development of the package and is open to volunteers that will contribute to/maintain cyhunspell.
Just to let you know in case you would be interested in doing so :)

@astariul
Copy link

I've opened a PR in cyhunspell to fix this compatibility issue (MSeal/cython_hunspell#43).

So until this PR is merged (if the maintainer is still active), you can use my branch.

@erdiari
Copy link
Contributor

erdiari commented Feb 20, 2023

I've opened a PR #5 that hopefully will mitigate this problem. I have replaced cyhunspell with spylls. It seems to be working as expected.

@meliksahturker
Copy link
Collaborator

@astariul Thanks for your effort, although the merged PR was not built on PyPi so it was unusable for us.
@emso-c This is fixed with spylls thanks to @erdiari.
VNLP now supports Python 3.10.
VNLP 0.2.3 is added to pypi and can be installed, so I am closing this issue.

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

4 participants