facebookresearch / DrQA

Reading Wikipedia to Answer Open-Domain Questions
Other
4.48k stars 898 forks source link

ModuleNotFoundError: No module named 'drqa' #255

Open JamesRead5737 opened 4 years ago

JamesRead5737 commented 4 years ago

When I run python3.8 scripts/pipeline/interactive.py I get the following error:

Traceback (most recent call last):
  File "scripts/pipeline/interactive.py", line 16, in <module>
    from drqa import pipeline
ModuleNotFoundError: No module named 'drqa'

Following output shows that setup.py script did not put drqa into my python path:

>>> import sys; print(sys.path)
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/yaakov/all/DrQA/pytorch_awesome/pytorch-awesome/lib/python3.8/site-packages']

So I added the path manually to PYTHONPATH like so:

export PYTHONPATH="/home/yaakov/all/DrQA/"

Running python3.8 scripts/pipeline/interactive.py then produces the following:

$ python3.8 scripts/pipeline/interactive.py 
Traceback (most recent call last):
  File "scripts/pipeline/interactive.py", line 16, in <module>
    from drqa import pipeline
  File "/home/yaakov/all/DrQA/drqa/__init__.py", line 20, in <module>
    from . import tokenizers
  File "/home/yaakov/all/DrQA/drqa/tokenizers/__init__.py", line 20, in <module>
    from .corenlp_tokenizer import CoreNLPTokenizer
  File "/home/yaakov/all/DrQA/drqa/tokenizers/corenlp_tokenizer.py", line 14, in <module>
    import pexpect
  File "/home/yaakov/all/DrQA/pytorch_awesome/pytorch-awesome/lib/python3.8/site-packages/pexpect/__init__.py", line 75, in <module>
    from .pty_spawn import spawn, spawnu
  File "/home/yaakov/all/DrQA/pytorch_awesome/pytorch-awesome/lib/python3.8/site-packages/pexpect/pty_spawn.py", line 14, in <module>
    from .spawnbase import SpawnBase
  File "/home/yaakov/all/DrQA/pytorch_awesome/pytorch-awesome/lib/python3.8/site-packages/pexpect/spawnbase.py", line 224
    def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
                                                               ^
SyntaxError: invalid syntax

With python3.6 the script gets a little further:

$ python3.6 scripts/pipeline/interactive.py 
Traceback (most recent call last):
  File "scripts/pipeline/interactive.py", line 16, in <module>
    from drqa import pipeline
  File "/home/yaakov/all/DrQA/drqa/__init__.py", line 22, in <module>
    from . import retriever
  File "/home/yaakov/all/DrQA/drqa/retriever/__init__.py", line 36, in <module>
    from .doc_db import DocDB
  File "/home/yaakov/all/DrQA/drqa/retriever/doc_db.py", line 9, in <module>
    import sqlite3
  File "/usr/local/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

Has anybody ever succeeded in getting this running on Ubuntu?

dbakuntsev commented 3 years ago

It would seem that pexpect package version is incompatible. Run pip install -U pexpect to update it.