explosion / explosion/spaCy

Fail to call Python code using Matlab

Open
#13,536 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
33.9k
Forks
4.7k
Avg merge
3m
Merged PRs (30d)
1

Description

## How to reproduce the behaviour

Python code: File name: test_spacy.py

```
import spacy
nlp = spacy.load("en_core_web_lg")
doc = nlp("This is a sentence.")
```
No error while run the python code using Pycharm IDE.
Matlab code for calling the python code

```
pyenv;
py.importlib.import_module('test_spacy');
path_add = fileparts(which('test_spacy.py'));
if count(py.sys.path, path_add) == 0
insert(py.sys.path, int64(0), path_add);
end
```

Error occurred while run the Matlab code: Error using numpy_ops>init thinc.backends.numpy_ops
Python Error: ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from
PyObject

Matlab and python codes all are in the same folder. Created a python project using PyCharm. Then crated the Matlab file and saved the file in the Python project file
## Your Environment

* Operating System: Windows 11
* Python Version Used: 3.12.3
* spaCy Version Used: 3.7.5
* Environment Information: C:\Users\cse_s\AppData\Local\Programs\Python\Python312\Lib\site-packages\spacy

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.