I’m trying to import spacy to use on VSCode, but I am getting an error: “Exception has occurred: ImportError cannot import name Deque.”
I did pip install -U spacy in my virtual environment. Wondering how to solve the error so that I can use spacy? This import error goes away if I try other Python libraries. For ex, “import nltk” works fine.
Advertisement
Answer
It is recommended that you reinstall the module “spacy” in the currently selected Python environment (the python environment shown in the lower left corner of VS Code). You could use the command “pip show spacy
“(or pip3 show spacy
) to check the installation location of the module:
Debug:
If it still doesn’t work, please try to reinstall the python extension and reload VS Code.