Install Specific Version of Spacy using Python PIP
Last Updated :
20 Feb, 2024
SpaCy is basically an open-source Natural Language Processing (NLP) library used for advanced tasks in the NLP field, written in programming languages like Python and Cython. Sometimes, in your project, you don't want to use the updated version of SpaCy. In this case, you want to install the specific previous versions of Spacy. This article will let you know about installing the specific version of Spacy.
What is Specific in Python?
SpaCy is an open-source natural language processing (NLP) library for Python. It is designed to perform various NLP tasks, including tokenization, part-of-speech tagging, named entity recognition, and more. SpaCy is known for its efficiency, speed, and accuracy, making it a popular choice for developers and researchers working on projects that involve processing and understanding natural language text.
Installing Specific Version of SpaCy?
Below, is the step-by-step guide of How To Install Specific Version Of Spacy in Python.
Step 1: Create a Virtual Environment
First, create the virtual environment using the below commands
python -m venv env
.\env\Scripts\activate.ps1
Step 2: Install Spacy Library
To install a specific version of SpaCy, utilize the Python package manager "pip" in the command line or terminal of your operating system. Below are the commands to install a particular version, using version 3.2.3 of SpaCy as an example:
pip install spacy==3.2.3 # Windows
pip3 install spacy==3.2.3 # MacOS

To achieve the installation of a specific version and uninstall the latest version, use the following commands. In this example, version 3.2.3 of SpaCy is selected:

Step 3: Verify Using Pip
After successfully installing the specific version of SpaCy using the process outlined in step 1, you can verify the installation by executing the following commands in the command line or terminal of your operating system:
pip show spacy #Windows
pip3 show spacy # MacOS

The installed version 3.2.3 and many other details can be seen in the image above after typing the above commands in the terminal/command line ensuring that you have installed the desired version of SpaCy.
Code Examples
In this example, below code imports the SpaCy library and loads the English language model "en_core_web_sm." It then tokenizes the given text using SpaCy and prints each token in a processed document.
Python3
import spacy
# Loading the en_core_web_sm model, that is,English language model
nlp = spacy.load("en_core_web_sm")
text = "SpaCy is an open-source library for advanced Natural Language Processing in Python."
doc = nlp(text)
# Iterating over tokens in the processed document and printing them.
print("Tokenization using spaCy:")
for token in doc:
print(token.text)
Output
Tokenization using spaCy:
GeeksforGeeks
is
a
Coding
Platform
.
Conclusion
In conclusion , The SpaCy library which is popularly used in advanced NLP projects requires deep understanding and mastery of the versions and installations of specific versions in some NLP projects. By following the above process mentioned in this article, you can easily install the exact desired version of SpaCy, that is required for your NLP project needs.
Similar Reads
Upgrade Python virtual Environment to latest Version Python virtual environments are crucial for isolating project dependencies and managing different Python versions. As Python continually evolves, it's essential to keep your virtual environment up to date to benefit from the latest features, bug fixes, and security updates. In this step-by-step guid
2 min read
How To Upgrade Scikit-Learn Package In Anaconda Anaconda is a powerful platform widely used in the Python community for managing packages, dependencies, and environments. One of the most popular libraries for machine learning tasks in Python is scikit-learn. However, it's crucial to keep your libraries up to date to leverage the latest features,
3 min read
Install Poetry to Manage Python Dependencies Poetry is a modern and user-friendly dependency management tool for Python. It simplifies the process of managing project dependencies, packaging, and publishing. In this article, we will see how to install poetry in Python in Windows. What is Python Poetry?Python Poetry is a modern and comprehensiv
2 min read
Pipx : Python CLI package tool In this article, we will explore the basics of pipx python CLI package tool. Pipx is a tool in Python that allows us to run python packages that have a CLI interface in the global context of your system. It uses its own environment for managing the packages. Here, we will cover its installations, se
4 min read
Managing Packages in Pycharm Pycharm supports installation, uninstallation, and up-gradation of Python packages. By default, Pycharm makes use of the pip package manager for the same. Similarly, conda package managers are used to handle Conda environments. In this article, we will look into the process of managing python packag
3 min read