How to install requests module with pip? [duplicate] - python

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 2 years ago.
I'm trying to install the requests module with pip, but I'm not sure if I'm doing it right. I open up the command prompt on windows(windows key+r,type in 'cmd' and hit enter). I have pip already installed, but when I type in 'pip install requests' to the command prompt it says
C:\Users\khern>pip install requests
'pip' is not recognized as an internal or external command,
operable program or batch file.
When I go check if pip is installed, this comes up
C:\Users\khern>python -m pip --version
'python' is not recognized as an internal or external command,
operable program or batch file.
So, then I go to add python's path to the environment variables changing the top part and the bottom part so hopefully the command prompt can run python programs. But when I go to the command prompt and type python, it still says
C:\Users\khern>python
'python' is not recognized as an internal or external command,
operable program or batch file.
Can someone tell me what I'm doing wrong? I'm new to programming, and just want to install the 'requests' module to finish the class I'm taking on python. Thanks!

visit this link:
https://datatofish.com/add-python-to-windows-path/
this will tell you how to add python to a path on windows so that you can access python from anywhere on the system.
if you need to use pip to install request:
python -m pip install requests
but before you run that command you have to make sure you are in pip folder,
which generally looks something like this:
c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip

The python path I think is not selected. Try reinstalling python and do this:
solve python path
or this:
solve python path
Check out this link:
'python' is not recognized as an internal or external command

Related

How to create an executable with a pycharm python file though pyinstaller?

I have been trying to install pyinstaller in order to create an executable of a python project I have been working on, but my pip command simply doesn't work. This is the error I would get "'pip' is not recognized as an internal or external command, operable program or batch file". I have already checked the interpreter of my pycharm project, and it shows that it has pip already installed. I tried to look this up online, and I found out that a problem could be that the environment variable Path just needs to have the directory of my python version, but even after doing this, it still would not work. For additional information, I already tried to find the directory by using the command "where python" in the command prompt, but that path didn't work, and I'm using windows 10.
Usually for most of users, there would be a problem as you mention above. In such situation, you just need to install pip again with command like
python -m pip3 install -U pip
and remember next time, if pip reminds you to upgrade it, do not just use
pip install -U pip

pip install PATH set but not recognized by cmd [duplicate]

This question already has answers here:
What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?
(4 answers)
Closed 1 year ago.
I have set the install path for pip with "setx PATH" and checked to make sure pip is installed there but it still does not recognize pip. I also tried setting the path with the environment variable path editor with the same path;
C:\Users[user]\AppData\Local\Programs\Python\Python38\Lib\site-packages
but get the same result with pip not being recognized even though I can see pip installed there and Windows recognizes that.
C:\Users[user]>py -m ensurepip --upgrade Looking in links:
c:\Users[user]\AppData\Local\Temp\tmp5jiqkdus Requirement already
up-to-date: setuptools in
c:\users[user]\appdata\local\programs\python\python38\lib\site-packages
(49.2.1) Requirement already up-to-date: pip in
c:\users[user]\appdata\local\programs\python\python38\lib\site-packages
(20.2.1)
C:\Users[user]>pip 'pip' is not recognized as an internal or external
command, operable program or batch file.
C:\Users[user]>setx PATH
"%PATH%;C:\Users[user]\AppData\Local\Programs\Python\Python38\Lib\site-packages"
SUCCESS: Specified value was saved.
C:\Users[user]>pip 'pip' is not recognized as an internal or external
command, operable program or batch file.
I can also see a pip installed in
C:\Users[user]\AppData\Local
but since this was not what was recognized by "py -m ensurepip --upgrade" I figured that shouldn't be the path set. I tried setting the path for it regardless just to see and got the same result as the others.
C:\Users[user]>setx PATH "%PATH%;C:\Users[user]\AppData\Local"
SUCCESS: Specified value was saved.
C:\Users[user]>pip 'pip' is not recognized as an internal or external
command, operable program or batch file.
Why is windows not recognizing the pip path even though "py -m ensurepip --upgrade" does and I can see it installed there?
A way around to solve this problem is to actually use Anaconda if it is possible. It also uses pip but it offers a multitude of encapsulated environments and a user friendly interface.

pip install pyinstaller in cmd throws an error when trying using the command [duplicate]

This question already has answers here:
What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?
(4 answers)
Closed 1 year ago.
I Have the file first of all. In The website, it says type this into your cmd, pip install pyinstaller I am on windows 10 Hp PC. But, the Cmd says this
'pip' is not recognized as an internal or external command,
operable program or batch file.
How do I fix This And succesfully install?
you need to first install pip. this can be done via CMD navigate to your working directory and then use the following command:
python get-pip.py.
I hope this solves your issue
I think you have not added PIP to path. Go to https://datatofish.com/add-python-to-windows-path/ to see more details.

How do I use pip install?

When I look up tutorials on Python almost every one starts with "Start of with pip install bs4" but they never tell me about how. Because when I write "pip install bs4" in my cmd the answer I get is only
'pip' is not recognized as an internal or external command,
operable program or batch file.
I've tried running "pip install bs4" in PyCharm as well but nothing works.
I am a totally a beginner, which you probably already noticed, and just want to get beautifulsoup.
I'm going to assume you're on Windows since your error message contains "batch file". Try:
py -m pip install bs4
The -m flag will import the pip module, and allow you to run the install command. If running py doesn't work, try the absolute path to your python.exe.
This is the official site that shows you how to download and install python pip
pretty much just download the file, open up the command prompt, cd to file directory and run it with:
python get-pip.py

Installing Python packages through pip?

I am trying to install the python package pyperclip.
I've been trying to do this for a while now, but it's simply not working. Here is what I've tried (from other answers on the internet):
Opened Windows Powershell, changed the directory to where I installed Python. The location of the file is below:
C:\Users\Jamie\AppData\Local\Programs\Python\Python37\Scripts
Entered the command pip install pyperclip. I get the following error message:
pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
I also get the following suggestion from Powershell:
Suggestion [3,General]: The command pip was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\pip". See "get-help about_Command_Precedence" for more details.
Entered the command python -m pip install pyperclip. Here, nothing happens. I get no error message but I still can't import the package in Python IDLE.
I don't know what else to do? Any help is appreciated.
SOLVED: I ran the same command on cmd instead of PowerShell and it worked. Not sure why, though.

Categories

Resources