alvations / pywsd

Python Implementations of Word Sense Disambiguation (WSD) Technologies.
MIT License
744 stars 132 forks source link

hit ImportError: cannot import name 'WordNet' from 'wn' #65

Open TonyZhang03 opened 3 years ago

TonyZhang03 commented 3 years ago

When running the example code given, hit above error. image

frankTian92 commented 3 years ago

I got the same error of "cannot import name 'WordNet' from 'wn'". And one more question, what is the wn? I do not find the definition of wn.

frankTian92 commented 3 years ago

I have solved this problem. It is because the version of 'wn' package is too high. I have degrade 'wn' to the version of 0.0.23, and it works

goodmami commented 3 years ago

This was fixed in 20885bf347e4016174de8a0eaf593d7a3f37b28c but, currently, only if you install from the source code. The last release on GitHub and version on PyPI do not include the change.

YashMeh commented 3 years ago

I solved this issue by specifying the pywsd version for python3

pip3 install pywsd==1.0.2
Cbhihe commented 3 years ago

This exact same issue is still hot. @YashMeh 's suggestion above helps you get out of the rut even though the working version is not the latest when installing from PyPI.org with python -m pip install pywsd==1.0.2.

@goodmami: Is there a notion of when the fix will reach the package on GitHub and PyPI.org ?

(Thanks to the code authors and contributors for making this available.)

goodmami commented 3 years ago

@Cbhihe I am not a maintainer of this project, so I cannot say.

@alvations any chance we can get a new release on PyPI? It only needs to be the current code on GitHub plus a new version (also see #64; the 1.2.4 release on PyPI is from 2019 but the version string in the Git repository was only changed to 1.2.4 earlier this year). As mentioned on https://github.com/alvations/pywsd/pull/68#issuecomment-937974154, we need a new version string, like 1.2.5 or 1.3.

AliFadaei90 commented 2 years ago

I solved this issue by specifying the pywsd version for python3

pip3 install pywsd==1.0.2

Worked

goodmami commented 2 years ago

@alvations any chance we can get a new release on PyPI? It only needs to be the current code on GitHub plus a new version (also see https://github.com/alvations/pywsd/issues/64; the 1.2.4 release on PyPI is from 2019 but the version string in the Git repository was only changed to 1.2.4 earlier this year). As mentioned on https://github.com/alvations/pywsd/pull/68#issuecomment-937974154, we need a new version string, like 1.2.5 or 1.3.

@alvations pretty please?