You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Saswati-Project The error you're encountering is indicative of a binary incompatibility between NumPy and another library, likely one that spaCy depends on, such as Thinc. This can occur when libraries are compiled against different versions of NumPy or when there are mismatched versions of the libraries.
You might try these steps and let me know, if it works,
Make sure MATLAB is using the same Python environment where you have your packages installed. You can set the Python environment explicitly in MATLAB.
Ensure that all the packages (including NumPy, spaCy, and Thinc) are up-to-date and compatible. You can do this in your Python environment.
Test with a sample python script, before running on matlab for consistency,
import spacy
def test_spacy_function():
nlp = spacy.load("en_core_web_lg")
doc = nlp("This is a sentence.")
return [(token.text, token.pos_) for token in doc]
After confirming the Python script works independently, call it from MATLAB:-
a. Set the Python environment in MATLAB
spaCy version 3.7.5
Location C:\Users\cse_s\AppData\Local\Programs\Python\Python312\Lib\site-packages\spacy
Platform Windows-11
Python version 3.12.3
Pipelines en_core_web_lg (3.7.1)
I want to call the Spacy code using Matlab. The Spacy code is as follows which work well using Pycharm IDE.
However, the Matlab code throws errors
The Matlab code is
test_spacy is the python file name that I have. How can I solve this issue?
The text was updated successfully, but these errors were encountered: