alvations / pywsd

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

pywsd correctly installed but get error when import (python 3) #56

Closed elioamicarelli closed 5 years ago

elioamicarelli commented 5 years ago

Hi, according with my terminal I have successfully installed pywsd on python 3 (see install log below) however, when I import pyswd from python I get the following error. Can you help me to fix it? Thanks a lot!

ERROR LOG

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3326, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in import pywsd File "/usr/share/java/pycharm-community/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "/usr/local/lib/python3.7/site-packages/pywsd/init.py", line 14, in from wn import WordNet File "/usr/share/java/pycharm-community/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) File "/usr/local/lib/python3.7/site-packages/wn/init.py", line 10, in from wn.constants import File "/usr/share/java/pycharm-community/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) File "/usr/local/lib/python3.7/site-packages/wn/constants.py", line 196, in exception_map = load_exception_map() File "/usr/local/lib/python3.7/site-packages/wn/constants.py", line 126, in load_exception_map with open(wordnet_dir+'%s.exc' % suffix) as fin: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/site-packages/wn/data/wordnet-3.3/adj.exc'

########## INSTALL LOG ###########

pip3 install pywsd

Collecting pywsd Downloading https://files.pythonhosted.org/packages/8c/79/39597ff5510a63f44c9d4ce2f6a8200bbb1ae9c7b50ef90fe1f851f2c10d/pywsd-1.2.1.tar.gz (23.7MB) 100% |████████████████████████████████| 23.7MB 1.3MB/s Requirement already satisfied: nltk in /usr/local/lib/python3.7/site-packages (from pywsd) (3.4.4) Requirement already satisfied: numpy in /usr/local/lib64/python3.7/site-packages (from pywsd) (1.16.4) Collecting pandas (from pywsd) Downloading https://files.pythonhosted.org/packages/7e/ab/ea76361f9d3e732e114adcd801d2820d5319c23d0ac5482fa3b412db217e/pandas-0.25.1-cp37-cp37m-manylinux1_x86_64.whl (10.4MB) 100% |████████████████████████████████| 10.4MB 1.2MB/s Collecting wn (from pywsd) Downloading https://files.pythonhosted.org/packages/c4/ee/171109f853370256cce3fc10e2574bc4b4165503332e1c327217f855bf92/wn-0.0.20.tar.gz (12.0MB) 100% |████████████████████████████████| 12.1MB 2.9MB/s Requirement already satisfied: six in /usr/lib/python3.7/site-packages (from pywsd) (1.11.0) Requirement already satisfied: python-dateutil>=2.6.1 in /usr/lib/python3.7/site-packages (from pandas->pywsd) (2.7.5) Requirement already satisfied: pytz>=2017.2 in /usr/lib/python3.7/site-packages (from pandas->pywsd) (2018.5) Building wheels for collected packages: pywsd, wn Running setup.py bdist_wheel for pywsd ... done Stored in directory: /root/.cache/pip/wheels/0f/44/85/3829bb6c6188f30e13ba8981e8038c61db494a9788ea3bed01 Running setup.py bdist_wheel for wn ... done Stored in directory: /root/.cache/pip/wheels/80/68/3b/f1101703d1b65ef59fb45b1e4d2623d8329349785304db5fa2 Successfully built pywsd wn Installing collected packages: pandas, wn, pywsd Successfully installed pandas-0.25.1 pywsd-1.2.1 wn-0.0.20

alvations commented 5 years ago

Sorry, the wn package didn't update the dataset after the latest upgrade. Could you do a pip install -U pywsd, then the wn-0.0.22 version should be there and pywsd should work as expected?

elioamicarelli commented 5 years ago

Perfect! Thanks!