hey guys welcome to the next blog on python tutorial for beginners in the last blog I have shown you how you can install and manage your packages using Python pip now in this blog I'm going to show you how you can install and manage your pip packages using PyCharm IDE so here I have a very simple OpenCV Python script which I used to load this image which is Python logo dot PNG file now in order to run this script I need to import this package which is called cb2 and this package is available on Python package index so let me just open the pi pi dot o-r-g website and let me search for OpenCV here and when I search for OpenCV you will be able to see multiple OpenCV related packages but the one I want to install is this one which is OpenCV - python so i'm going to click on this package to see more details about this package so you can see the latest version of this package at that time of making this blog is three point four point three point eighteen and in order to install this package with pip you just need to run this command which is PIP install OpenCV - python now in order to import this OpenCV - python on your PyCharm ide what you need to do is just create your project and write your code and then go to the file and then go to the settings so just choose the settings option here and once the settings option is open you will be able to see different categories here you need to choose this category which says project : the name of your project and then click on project interpreter now by default some packages are already available here which is PIP and setup tools and we want to install a special package which is OpenCV - python so in order to add this package you just need to click on this plus button so I'm going to click on this plus button and you will be able to see this search bar here so here you just need to search for the package you are looking for so I have just entered open CV - Python here and the first option which is available here I have just selected it and you can see this is the same package which we have seen on the Python package index website so let's match this once again so here you can see the latest version as three point four point three point eighteen and here also the latest version is the same and the description is also same so wrapper package for OpenCV python bindings and here also the description is same so this is the package we want to install if you want to see the github repository also I'm going to just scroll here and then I'm going to open the github page from the PI pi website for this open CV - Python and this github URL is also same which we are seeing on the PyCharm IDE so now we know that we need to install this package which is open CV - Python so we just need to click on this button which says install package which is going to install this package for your project and after some time you will be able to see this message which says package open CV - Python installed successfully so I'm going to just close this window and after closing this window you will be able to see that this open CV is now visible in your project interpreter and now we are going to click once again ok and once you click OK you will be able to see here at the bottom some processes are running which is the process of importing this library into your project and after some time you will see that this red squiggly line for the error has disappeared from the import CV line so now we will be able to run this code so let's run this code and let's verify if everything is working fine so I'm going to just right click and then click on run the project name or the file name and it has opened the picture which I want to open which is this Python logo picture so this is how you can install and manage your pip packages using PyCharm IDE I hope you have enjoyed this blog and I will see you in the next blog
Post a Comment