In this video I take you through one of the most common and frustrating issues in creating python programs - pip not working!
Pip is the python package or module installer, that should come built in with you python installations, but almost every new programmer will have to deal with the very common and very annoying error message - 'pip' not recognized as internal or external command, operable program or batch file.
There are several different ways to try and fix this and work around the error, and in this video I walk you through several of the most common methods!
Hopefully this solves the problem for you, but if it doesn't leave me a comment letting me know what you've tried and I'll try to help there as well!
Be sure to subscribe to the channel to check out all of the great content there and to stay tuned on the great stuff to come in the future!
Thanks for watching and goodluck with your code!
what's up you guys welcome back to the
channel in today's video I'm going to
show you some basic troubleshooting
steps you can take if pip isn't working
to install modules in your python
project
[Music]
alright so welcome back to the channel
right before I dive into the concepts I
just want to say thank you to everyone
who voted on the recent poll on the
channel on whether our next big project
should be a playable guitar program or a
rebuild of classic Pac-Man Pac-Man won
by a substantial margin so that'll be
the next big project we do on the
channel I'm working on that it's close
to finish so expect that tutorial in the
next week or two be sure to hit
subscribe to the channel so you don't
miss it when it comes out and without
any further Ado let's jump into the
concepts for this video
so pip is the basic installer command to
bring outside modules into your Python
program so if you're building a game or
you're doing something with data
analytics or math or you want graphs
then there are all these different
modules Pi game Pi audio numpy
matplotlib all these different modules
that you need to bring into your program
and if you've followed a lot of YouTube
tutorials including my own tutorials a
lot of them are guilty of just saying in
the beginning okay first thing we're
going to do is import pygame if you
don't have it in your code then just run
pip to install it and you've probably
heard things like that at the beginning
of tutorials again I've done it myself
some of the great uh IDE integrated
development environments actually come
with like this little terminal plug-in
and so you can usually just come down
here and type in PIP install pygame or
whatever the module is and hit enter and
if everything's great if everything was
installed correctly and set up correctly
then a lot of the times that works right
away and you'll just get this
successfully installed Pi game whatever
whatever right at the bottom and then
all of a sudden like the red squiggly
lines will go away and it'll stop
throwing errors because now your program
has pi game even more annoying sometimes
well it's not annoying it's a great
feature but maybe you've seen projects
where like they say import Pi audio and
especially like if you're using pycharm
sometimes you can just hover over it and
it'll have this install package Pi audio
like option so it'll run the installer
for you and then you have the package
and that's great if everything works but
I've seen a ton of comments on my videos
and on other YouTube tutorial channels
that say I can't even follow along with
this tutorial because pip isn't working
for me what do I do if pip isn't working
so here's a few things you can try
because a lot of the articles I saw
online basically say reinstall python
you probably installed python wrong
we'll get to that that's a piece of it
but here's a few things you can try
before doing that and then we'll talk
about how to make sure if you do
reinstall python you do it correctly
so there are a few things that you can
try right away if pip install isn't just
working by default then there's always a
chance that maybe you have python
installed in a different place than your
IDE so what you need to do is you might
need to look into your project and
figure out what the full address of your
project is so for this one
it's C users plema pie chart projects
pip not working so if I had installed
Python and just like my root C drive
sometimes if you just try to run pip
install like right here
it's going to tell you it can't because
it's like
um well pip isn't recognized because you
have to point it to whatever Place
python is installed in so if you have
python installed inside of this project
then what you can try is you can try the
full address so this is a little tedious
to type out so I'm only going to do it
once but you could try C colon forward
slash users forward slash plema forward
slash pycharm projects and this is going
to be really annoying if I make a typo
slash uh pip what I call it not working
because that's a descriptive project
name and then uh forward slash
python so forward slash and you want to
point it to where we are inside the
project even so v e and V are virtual
environment and then forward slash
Scripts
and then forwards backslash I keep
saying forward slash python.exe and then
Dash M and then pip install and we'll do
another one we don't have yet numpy so
sometimes typing out this full address
is what you have to do if you have
python installed in an in a place that's
just by default not going to installing
me to upgrade pip but you can see it
installed the collected package numpy so
now if underneath Pi audio I typed in
import
numpy right away it's not going to give
me an error it will go gray because I'm
not using it in my project but uh it
won't give me an error because I just
successfully installed it so one thing
you can try is pointing it at your
project if that doesn't work one more
thing you can try it's very similar you
type in that whole command but instead
of install the package you can try this
install and then dash dash upgrade pip
and maybe you have an old version of pip
maybe it's just a matter of how long ago
you installed python or you installed an
out of date version of pip it's possible
so you can try running upgrade pip in my
case it says requirement already
satisfied because I have a newer version
of pip but that's another thing you can
try to repair it and then after you've
get this successfully installed you can
try installing a module again hopefully
that works
now if none of that has worked
unfortunately we are at the point where
the online articles are actually right
and what you are going to want to try to
do is reinstall python so you want to
start by going and uninstalling it from
your programs and uninstalling it from
your computer fortunately the full
install of python and an interpreter
only takes a couple of minutes so go to
your programs on your computer and
uninstall python
and then when you reinstall it you can
just get it from python.org I believe
it's python.org
um
when you reinstall it there's a few
things you want to check for so when
you're reinstalling it make sure the add
python3. whatever
to path check box is checked so you want
to add it to the path that's basically
saying there's going to be pathing built
into your computer so it knows how to
find python if you just address it from
a command line so make sure that that
box is checked and then the next thing
you need to check on an installation is
you want to select customize
installation and make sure that pip is
checked in optional features so most of
the time by default pip will be checked
but you just need to double check that
because sometimes people will go in
customize installation and they'll
remove some of those things that seem
optional because it takes up more space
on their computer or they think let me
just get Bare Bones python whatever it
is you want pip to be checked in
optional features it makes adding
packages to your project so much easier
so check those things out and then once
you've reinstalled python try it you
shouldn't actually have to reinstall
your IDE because it's typically just
something you have to solve at the
python level but if it's still not
working it might be time to reinstall
the IDE again just in case you got a
corrupted installation of your IDE it
varies there are so many different
integrated development environments that
I can't possibly tell you a separate fix
for every single one of them but I will
say pycharm at one point was not
correctly pulling from python for me so
I had to install it once so that's a
kind of a last-ditch effort but then at
the end of all of that you should be
able to run pip and install modules and
these are the best tips I can give you
for troubleshooting pip I really hope
this helps some of you if you've really
gone through all of the steps I talked
about in this project and it's still not
working for you then you may want to do
some deep diving into the internet maybe
it's the version of Windows or iOS Mac
or Linux that you're running it could be
a compatibility issue there are some
issues between Python versions two point
whatever whatever and three point
whatever whatever some Ides have project
settings where you can add modules in
your IDE rather than needing to change
stuff at the python level
so there are a million fixes for it out
there but this is the most common way to
get it working for most people and this
has personally helped me out a lot so I
hope you found this useful if you did be
sure to leave a like on the video
subscribe to the channel to keep up to
speed on everything that's coming out in
the coming weeks and be sure to let me
know in the comments if you found this
useful and what you'd like to see more
of on the channel in the future I am
still getting set up in Colorado so
apologize if there's any shaky camera or
any kind of a bugs in the production I'm
just trying to get back up and running
after my move so thank you everybody for
the continued support on the channel
it's unbelievable to me that we're
approaching 2 000 subscribers uh it's
been really a fantastic journey and I'm
looking forward to making tons more
videos with you guys in the future so as
always good luck with your code and
thanks for watching thanks bye