简体   繁体   中英

Cannot install spacy in pycharm

I've tried installing spaCy numerous times. At first I was getting an error noting that C++ needed to be upgraded to version 14. Now I'm getting a number of errors below that seem to indicate that there are numerous errors with portions of the install throughout the package.

I've since done that and now I'm getting separate errors. Below is the entire error:

  Using cached spacy-3.3.0.tar.gz (1.1 MB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'error'

  error: subprocess-exited-with-error
  
  pip subprocess to install build dependencies did not run successfully.
  exit code: 1
  
  [130 lines of output]
  Collecting setuptools
    Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB)
  Collecting cython<3.0,>=0.25
    Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
  Collecting cymem<2.1.0,>=2.0.2
    Using cached cymem-2.0.6.tar.gz (8.2 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Installing backend dependencies: started
    Installing backend dependencies: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
  Collecting preshed<3.1.0,>=3.0.2
    Using cached preshed-3.0.6.tar.gz (14 kB)
    Installing build dependencies: started
    Installing build dependencies: still running...
    Installing build dependencies: finished with status 'error'
    error: subprocess-exited-with-error
  
    pip subprocess to install build dependencies did not run successfully.
    exit code: 1
  
    [94 lines of output]
    Collecting setuptools
      Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB)
    Collecting cython>=0.28
      Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
    Collecting cymem<2.1.0,>=2.0.2
      Using cached cymem-2.0.6.tar.gz (8.2 kB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Installing backend dependencies: started
      Installing backend dependencies: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
    Collecting murmurhash<1.1.0,>=0.28.0
      Using cached murmurhash-1.0.7.tar.gz (12 kB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Installing backend dependencies: started
      Installing backend dependencies: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
    Building wheels for collected packages: cymem, murmurhash
      Building wheel for cymem (pyproject.toml): started
      Building wheel for cymem (pyproject.toml): finished with status 'error'
      error: subprocess-exited-with-error
  
      Building wheel for cymem (pyproject.toml) did not run successfully.
      exit code: 1
  
      [19 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win32-cpython-38
      creating build\lib.win32-cpython-38\cymem
      copying cymem\about.py -> build\lib.win32-cpython-38\cymem
      copying cymem\__init__.py -> build\lib.win32-cpython-38\cymem
      package init file 'cymem\tests\__init__.py' not found (or not a regular file)
      creating build\lib.win32-cpython-38\cymem\tests
      copying cymem\tests\test_import.py -> build\lib.win32-cpython-38\cymem\tests
      copying cymem\cymem.pyx -> build\lib.win32-cpython-38\cymem
      copying cymem\cymem.pxd -> build\lib.win32-cpython-38\cymem
      copying cymem\__init__.pxd -> build\lib.win32-cpython-38\cymem
      warning: build_py: byte-compiling is disabled, skipping.
  
      running build_ext
      building 'cymem.cymem' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build T: enter code here`https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]
  
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for cymem
      Building wheel for murmurhash (pyproject.toml): started
      Building wheel for murmurhash (pyproject.toml): finished with status 'error'
      error: subprocess-exited-with-error
  
      Building wheel for murmurhash (pyproject.toml) did not run successfully.
      exit code: 1
  
      [24 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win32-cpython-38
      creating build\lib.win32-cpython-38\murmurhash
      copying murmurhash\about.py -> build\lib.win32-cpython-38\murmurhash
      copying murmurhash\__init__.py -> build\lib.win32-cpython-38\murmurhash
      creating build\lib.win32-cpython-38\murmurhash\tests
      copying murmurhash\tests\test_against_mmh3.py -> build\lib.win32-cpython-38\murmurhash\tests
      copying murmurhash\tests\test_import.py -> build\lib.win32-cpython-38\murmurhash\tests
      copying murmurhash\tests\__init__.py -> build\lib.win32-cpython-38\murmurhash\tests
      copying murmurhash\mrmr.pyx -> build\lib.win32-cpython-38\murmurhash
      copying murmurhash\mrmr.pxd -> build\lib.win32-cpython-38\murmurhash
      copying murmurhash\__init__.pxd -> build\lib.win32-cpython-38\murmurhash
      creating build\lib.win32-cpython-38\murmurhash\include
      creating build\lib.win32-cpython-38\murmurhash\include\murmurhash
      copying murmurhash\include\murmurhash\MurmurHash2.h -> build\lib.win32-cpython-38\murmurhash\include\murmurhash
      copying murmurhash\include\murmurhash\MurmurHash3.h -> build\lib.win32-cpython-38\murmurhash\include\murmurhash
      warning: build_py: byte-compiling is disabled, skipping.
  
      running build_ext
      building 'murmurhash.mrmr' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]
  
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for murmurhash
    Failed to build cymem murmurhash
    ERROR: Could not build wheels for cymem, murmurhash, which is required to install pyproject.toml-based projects
    [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error
  
  pip subprocess to install build dependencies did not run successfully.
  exit code: 1
  
  See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

pip subprocess to install build dependencies did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.```

Although not sure , you could try this steps :

Open File > Settings > Project from the PyCharm menu.

Select your current project.

Click the Python Interpreter tab within your project tab.

Click the small + symbol to add a new library to the project.

Now type in the library to be installed, in your example "spacy" without quotes, and click Install Package .

Wait for the installation to terminate and close all popup windows

you can also check the link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM