spaCy:错误:命令错误,退出状态为1

时间:2020-04-06 13:39:39

标签: spacy

我正在尝试在conda环境中安装spacy,但是安装失败并显示以下错误消息:

$ pip install -U spacy --no-cache
Collecting spacy
  Downloading spacy-2.2.4.tar.gz (6.1 MB)
     |████████████████████████████████| 6.1 MB 4.1 MB/s 
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /home/sfalk/miniconda3/envs/t2t/bin/python /home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-cbh_k9yk/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.0
       cwd: None
  Complete output (41 lines):
  Traceback (most recent call last):
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/__main__.py", line 19, in <module>
      sys.exit(_main())
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/cli/main.py", line 73, in main
      command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
      module = importlib.import_module(module_path)
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/importlib/__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 985, in _gcd_import
    File "<frozen importlib._bootstrap>", line 968, in _find_and_load
    File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 697, in exec_module
    File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 24, in <module>
      from pip._internal.cli.req_command import RequirementCommand
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/cli/req_command.py", line 21, in <module>
      from pip._internal.req.constructors import (
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/req/__init__.py", line 11, in <module>
      from .req_file import parse_requirements
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/req/req_file.py", line 25, in <module>
      from pip._internal.req.constructors import (
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/req/constructors.py", line 28, in <module>
      from pip._internal.req.req_install import InstallRequirement
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 30, in <module>
      from pip._internal.operations.install.wheel import install_wheel
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip/_internal/operations/install/wheel.py", line 10, in <module>
      import compileall
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/compileall.py", line 20, in <module>
      from concurrent.futures import ProcessPoolExecutor
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/concurrent/futures/__init__.py", line 8, in <module>
      from concurrent.futures._base import (FIRST_COMPLETED,
    File "/home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/concurrent/futures/_base.py", line 381
      raise exception_type, self._exception, self._traceback
                          ^
  SyntaxError: invalid syntax
  ----------------------------------------
ERROR: Command errored out with exit status 1: /home/sfalk/miniconda3/envs/t2t/bin/python /home/sfalk/miniconda3/envs/t2t/lib/python3.5/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-cbh_k9yk/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.0 Check the logs for full command output.

不知道那里发生了什么。 SyntaxError

有什么解决方法吗?

1 个答案:

答案 0 :(得分:0)

我描述了here对我有用的东西。我在尝试将spaCy安装到32位环境中时遇到类似的错误。当我将我的virtualenv重建为64位时,我能够很好地安装。