microsoft / macaw

An Extensible Conversational Information Seeking Platform
MIT License
154 stars 43 forks source link

Syntax Error in running `live_main.py` after following all the prerequisite steps. #5

Open akaysh opened 3 years ago

akaysh commented 3 years ago

Using Ubuntu and all the specified versions of the libraries given in the macaw repo readme.

Traceback (most recent call last):
  File "live_main.py", line 8, in <module>
    from macaw.core import mrc, retrieval
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/local/lib/python3.8/dist-packages/macaw-0.1-py3.8.egg/macaw/core/mrc/__init__.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/local/lib/python3.8/dist-packages/macaw-0.1-py3.8.egg/macaw/core/mrc/drqa_mrc.py", line 5, in <module>
  File "/home/asharma19/dev/DrQA/drqa/__init__.py", line 20, in <module>
    from . import tokenizers
  File "/home/asharma19/dev/DrQA/drqa/tokenizers/__init__.py", line 20, in <module>
    from .corenlp_tokenizer import CoreNLPTokenizer
  File "/home/asharma19/dev/DrQA/drqa/tokenizers/corenlp_tokenizer.py", line 14, in <module>
    import pexpect
  File "/home/asharma19/.local/lib/python3.8/site-packages/pexpect/__init__.py", line 75, in <module>
    from .pty_spawn import spawn, spawnu
  File "/home/asharma19/.local/lib/python3.8/site-packages/pexpect/pty_spawn.py", line 14, in <module>
    from .spawnbase import SpawnBase
  File "/home/asharma19/.local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 224
    def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
                                                               ^
SyntaxError: invalid syntax
markanthony97 commented 3 years ago

Upgrade pexpect, as from python 3.7 async is a reserved word; pip install pexpect --upgrade

Amit-GH commented 3 years ago

Upgrading pexpect to the latest version (4.8.0 at this time) solves the async keyword issue but creates problem with DrQA as that explicitly requires version 4.2.1 here.

markanthony97 commented 3 years ago

Upgrading pexpect to the latest version (4.8.0 at this time) solves the async keyword issue but creates problem with DrQA as that explicitly requires version 4.2.1 here.

At this point the only solutions I can think of are either:

  1. downgrading below python 3.7 (workaround)
  2. manually modify the async keywords in the pexpect source code (tedious and impractical)
  3. Create an issue in the DrQA repository and solve the version conflict (impractical)
Amit-GH commented 3 years ago

Option (1) suggested by Marco seems to be the only practical solution. However, for Mac one more issue is that indri-5.11 is only supported for Mac OSX 10.11.3. The documentation of indri-5.18 clearly says no support for OSX 10.12+ . On seeing this, I believe the best way forward is to use Docker for replicating the package on a Ubuntu (14.04/16.04/18.04) flavour container.

phdahmed commented 2 years ago

I have upgraded pexpect to the latest version (4.8.0) and still the issue exist then upgrade it to (4.2.1) and still face the same issue, the error exactly similar to Akaysh query.

Amit-GH commented 2 years ago

I made some updates to this package and made it working in a Docker container. The updates were pushed here https://github.com/hamed-zamani/macaw . Check its documentation section.