【问题标题】:pip install for spacy in jupyter notebook failing在 jupyter notebook 中为 spacy 安装 pip 失败
【发布时间】:2020-01-24 11:01:01
【问题描述】:

我尝试了以下方法通过 anaconda 提示安装不同的包:spacy、fuzzywuzzy、levenshtein。

以下是我已经尝试过的事情:

Jupyter 笔记本:

!pip install spacy

CMD:

pip install spacy

Anaconda 提示:

conda install -c conda-forge/label/cf201901 spacy

这是 jupyter notebook 安装和 cmd 安装的结果:

Collecting spacy
  Using cached https://files.pythonhosted.org/packages/58/f2/5a23bb7251988da474eec844b692760cb0a317912291afc77b516f399cff/spacy-2.1.8.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\lenovo\appdata\local\programs\python\python37-32\python.exe' 'c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-du1j0vhu\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0'
       cwd: None
  Complete output (31 lines):
  Traceback (most recent call last):
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\__main__.py", line 16, in <module>
      from pip._internal import main as _main  # isort:skip # noqa
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
      from pip._internal.cli.main_parser import create_main_parser
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\cli\main_parser.py", line 11, in <module>
      from pip._internal.commands import (
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\commands\__init__.py", line 6, in <module>
      from pip._internal.commands.completion import CompletionCommand
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\commands\completion.py", line 6, in <module>
      from pip._internal.cli.base_command import Command
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\cli\base_command.py", line 26, in <module>
      from pip._internal.index import PackageFinder
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\index.py", line 38, in <module>
      from pip._internal.wheel import Wheel
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\wheel.py", line 7, in <module>
      import compileall
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\compileall.py", line 20, in <module>
      from concurrent.futures import ProcessPoolExecutor
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\concurrent\futures\__init__.py", line 8, in <module>
      from concurrent.futures._base import (FIRST_COMPLETED,
    File "c:\users\lenovo\appdata\local\programs\python\python37-32\lib\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: 'c:\users\lenovo\appdata\local\programs\python\python37-32\python.exe' 'c:\users\lenovo\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-du1j0vhu\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0' Check the logs for full command output.


As for the conda install, I get the following:
(base) C:\Users\Lenovo>conda install -c conda-forge/label/cf201901 spacy
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.

【问题讨论】:

  • 你可以试试!pip install spacy --ignore-installed

标签: python pip conda spacy


【解决方案1】:

在命令行中运行以下代码:

conda install -c conda-forge spacy
conda install -c conda-forge/label/gcc7 spacy
conda install -c conda-forge/label/cf201901 spacy 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    • 2022-12-01
    • 2018-12-25
    • 1970-01-01
    • 1970-01-01
    • 2018-05-02
    相关资源
    最近更新 更多