DIY-: How to pip install any module in Python -Programming tutorials EP010

in DIYHublast year

Greetings;

I hope everyone in this community is doing well. In my last programming post i made here, i promised my next post will be about how to pip install any inbuilt module that might not be instored in your Python app. Probably because you might be using a old version or the inbuilt module was recently released or modified. Well im here with a simple tutorial on how to do that.

Firstly we need to launch the python app, in my case the pycharm application. When we load our working space, just below it we should see an option labeled Terminal. Click on it, see screenshot below

The termial option will pop up and from there you can go ahead to type pip install + the name of the module you want to install. In my case i want to install qrcode module so i will type pip install qrcode and hit enter.

Then i get a notification telling me a new release of pip is available. This actually isn’t expected but lets go ahead to install the new pip version it would take just a few minutes. I type in the command as requested.

After typing in the command pip install - - upgrade pip install i got a red notification. And after cross checking it looks like a made a mistake in typing in the command.

I rectified my mistake and typed the correct command which is python.exe -m pip install --upgrade pip After which the old verison was successfully uninstalled for the new one to be installed.

Now we will try to install the qrcode module. We can achieve this by typing pip install qrcode and then hit enter. See screenshot below

From the screenshot above, the message say’s requirement already satisfied, this means i have previously installed it.

Now lets try another module i haven’t installed yet. LinearRegression. I had to try it out on the work space to find out if it has been installed already. When i typed it in, I received an error from Python meaning it hasn’t been installed. Now lets go ahead and install it.

Again we will type pip install LinearRegression and hit enter.

After hitting enter, it will take sometime to download and install. From the screenshot below, our module has been installed successfully

Now we go back to the workspace to see if it will recognize it now. After typing import, the moment i hit the L key on the keyboard, LinearRegression folder pops up for me to select it. Which clearly means it has been installed successfully.

Well i hope by now you guys have learnt on how to install any in built modules using pip install. And i almost forgot, you need internet connection to be able to do all this. If you have any questions i would be happy to hear them in the comment section until then see you on the next one. Thank you.

Sort:  
 last year  

Looks hard but good tutorial.

Looks can be deceiving😂. It’s quite simple to do.

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

Thanks for including @stemsocial as a beneficiary, which gives you stronger support.