Simple-QA-EMNLP-2018 icon indicating copy to clipboard operation
Simple-QA-EMNLP-2018 copied to clipboard

can't install the required packages

Open kato8966 opened this issue 2 years ago • 1 comments

I created a new environment "test" with Python 3.6. When I ran

$ python -m pip install -r requirements.txt

I got the following error.

Collecting git+git://github.com/PetrochukM/allennlp (from -r requirements.txt (line 14))
Cloning git://github.com/PetrochukM/allennlp to /tmp/pip-req-build-932446ln
  Running command git clone -q git://github.com/PetrochukM/allennlp /tmp/pip-req-build-932446ln
  Resolved git://github.com/PetrochukM/allennlp to commit ceab2e7a51d7d8791fdf35c7f6c46105a7d0adf8
    ERROR: Command errored out with exit status 1:
     command: /home/kato8966/anaconda3/envs/test/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-932446ln/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-932446ln/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-t14y823d
         cwd: /tmp/pip-req-build-932446ln/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-932446ln/setup.py", line 54, in <module>
        from allennlp import version
      File "/tmp/pip-req-build-932446ln/allennlp/__init__.py", line 10, in <module>
        import spacy, torch, numpy  # pylint: disable=multiple-imports
    ModuleNotFoundError: No module named 'spacy'
    ----------------------------------------
WARNING: Discarding git+git://github.com/PetrochukM/allennlp. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I am afraid to say that the install process mentioned in README.md might not be sufficient enough. If acceptable to you, I would be most grateful if you give me a more detailed process.

kato8966 avatar Dec 15 '21 07:12 kato8966

Tentatively, I solved the problem as follows.

  1. Divide requirements.txt into two files, req1.txt from line 1 to 13 and req2.txt for the rest.
  2. python -m pip install -r req1.txt
  3. Install spacy.
  4. python -m pip install -r req2.txt

kato8966 avatar Dec 15 '21 09:12 kato8966