Jinja is a python module for building web applications. It is modeled after the famous Django template. It is a very fast, secure, and widely used module. But many beginners are not able to properly install jinja in Pycharm. They get mostly import or no module not found an error. This tutorial is for them. In this entire tutorial, I will show you how to install jinja in Pycharm step by step.
Jinja Import Error
If you have not installed jinja in your Pycharm them you will see red underline color below the import error. It tells you that the module is not installed. So you have to install it before using its function. You will get an error like below.
Step by Step Guide on how to Install Jinja in Pycharm
Step 1: Go to File>>Setting and click on your project name. Like in our example it is jinja-installation.
You will see the image below.
Step 2: Click on Project Interpreter. There you will see all the list of installed python modules. You can clearly see there Jinja is not installed.
Step 3: After step 2, Click on the “+” sign. Then you will see the window with the search field.
Step 4: Type Jinja in the search field. You will see the list of Jinja Module.
Step 5: Select the Jinja2 Module as it a Latest Jinja Module. After that click on the Install Package.
It will start the installation of the Jinja Module. You will get the following image after the installation.
That’s all the steps you have to do successfully install Jinja in Pycharm.
If you are even getting error in the installation of the Jinja module. Then the next task you can do is to directly install it using the Pycharm terminal. Follow the below steps.
Step1: Go to Pycharm terminal. You will find it on the below side.
Step 2: Type the below command and press Enter.
For Python 3.xx
pip3 install Jinja2
For Python 2.xx
pip install Jinja2
Just wait for some time It will successfully install it.
How to check the version of the installed Module?
After doing the installation part you can check the Jinja Module version. To do so you have to print it after first importing it.
Run the following code and it will print its version.
import jinja2 print(jinja2.__version__)
In our example, its output is 2.11.2.
You can also use the Pycharm terminal to check the version. Go to the terminal (step 1) and type the following bash command there. It will print the current version of the Jinja Package installed in the Pycharm.
Jinja is very popular in designing web applications. These are step by step guide to properly install Jinja in Pycharm. Hope this article “how to install jinja in Pycharm” has helped you to successfully install the Jinja Module.
If you are still getting an error in installation, then you can contact us to get more help.
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.