Skip to content

Commit

Permalink
doc update - add faq for no module named spacy
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Feb 26, 2023
1 parent 2b7c497 commit 739f0b6
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Include header (convenience header including all modules):

#include <spacy/spacy>


Header-only Library
-------------------
Copy the src/spacy directory to the source directory of your project. Then
Expand All @@ -102,14 +101,32 @@ all headers):
#define SPACY_HEADER_ONLY
#include <spacy/spacy>


CMake Usage
-----------
The source tree includes two CMake project examples:

- [Using spacy-cpp as header-only library](examples/cmake-add-subdirectory-hdr)
- [Using spacy-cpp as shared library](examples/cmake-add-subdirectory-lib)


FAQ
===

### No module named spacy. Why does spacy-cpp not find spacy?
If a system has more than one Python installation, each of the installations
will have its own set of pip-installed Python packages. One must ensure that
spacy is installed for the Python version used by spacy-cpp (alternatively
point spacy-cpp to the desired Python installation). When building spacy-cpp
using CMake (example: `./make.sh tests`) the Python version used will be
output, for example `PYTHON_EXECUTABLE="/usr/local/bin/python3.11"`. Use this
interpreter to ensure spacy works correctly in Python, example:
`/usr/local/bin/python3.11 ./examples/python-spacy-usage.py`. If not working,
use this Python version to install spacy and a language model:

/usr/local/bin/python3.11 -m pip install -U spacy
/usr/local/bin/python3.11 -m spacy download en_core_web_sm


API Documentation
=================
Spacy-cpp is under development and does not support the complete spaCy API yet.
Expand Down

0 comments on commit 739f0b6

Please sign in to comment.