Forums

spacy import error "can not import spacy in app"

can not import spacy in my web app it is showing the error

import spacy

2023-03-28 05:09:54.326404: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart. so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-03-28 05:09:54.326445: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2023-03-28 05:09:58.687912: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so .1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory 2023-03-28 05:09:58.687943: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303) 2023-03-28 05:09:58.687979: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (green-liveconsole8): /proc/driver/nvidia/version does not exist

There is no GPU on the server so there is no driver.

how i can run it on cpu

According to the spacy docs, you need to install it for CPU:

pip install --user -U spacy

or remove the --user if you are installing into a virtualenv. Just make sure that the virtualenv is enabled when you install.