aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.31k stars 337 forks source link

cannot import name 'SIGPIPE' when downloading models. #106

Open shebasarah opened 7 years ago

shebasarah commented 7 years ago

Using polyglot-16.7.4 and python 3.5 on windows 7

C:\Users\a>polyglot download morph2.en Traceback (most recent call last): File "C:\Users\a\Anaconda3\Scripts\polyglot- script.py", line 11, in load_entry_point('polyglot==16.7.4', 'console_scripts', 'polyglot')() File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 561, in load_entry_point File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 2649, in load_entry_point File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 2303, in load File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 2309, in resolve File "C:\Users\a\Anaconda3\lib\site-packages\polyglot-16.7.4-py3.5.egg\polyglotmain.py", line 9, in from signal import signal, SIGPIPE, SIG_DFL ImportError: cannot import name 'SIGPIPE'

This seems like a bug of polyglot on windows. A quick local fix (as suggested by @alexgarel) is to edit this file and remove all ref to SIGPIPE (won't affect the behaviour of polyglot).

KirtimanS commented 7 years ago

After removing all the references to SIGPIPE , I still can;t download morph2.en. Attached is the log:

polyglot download morph2.en [polyglot_data] Error loading morph2.en: Package 'morph2.en' not found [polyglot_data] in index Error installing package. Retry? [n/y/e] y Traceback (most recent call last): File "C:\ProgramData\Anaconda3\Scripts\polyglot-script.py", line 11, in load_entry_point('polyglot==16.7.4', 'console_scripts', 'polyglot')() File "C:\ProgramData\Anaconda3\lib\site-packages\polyglot-16.7.4-py3.6.egg\polyglot__main.py", line 279, in main args.func(args) File "C:\ProgramData\Anaconda3\lib\site-packages\polyglot-16.7.4-py3.6.egg\polyglot\main__.py", line 109, in download halt_on_error=args.halt_on_error) File "C:\ProgramData\Anaconda3\lib\site-packages\polyglot-16.7.4-py3.6.egg\polyglot\downloader.py", line 676, in download if not self.download(msg.package.id, download_dir, AttributeError: 'NoneType' object has no attribute 'id'

Zoher15 commented 6 years ago

@KirtimanS @alexgarel @pythonabehs Did this get solved? I have this error: "AttributeError: 'NoneType' object has no attribute 'id'"