Pip version can't be displayed from cmd terminal [duplicate] - python

This question already has answers here:
Python command not working in command prompt
(24 answers)
Closed 3 years ago.
Sorry for the simple question (I am brand new to this)
I'm currently using Python 3.7. It came with pip installed automatically but I am unable to get it to display the current version from CMD (I use windows 10)
However, in the Pycharm terminal it works perfectly. I don't know why everyone says "pip --version" should work in CMD. I tried it and it didn't work.
What could be the cause?
I've tried using the same commands everyone else uses to display current pip version.
location for pip installment is C:\Users\"Username"\Desktop\untitled\venv\Scripts
when i run pip --version or just pip it says in cmd 'pip' is not recognized as an internal or external command,
operable program or batch file.
Running cmd as admin didn't help either.
It's not a crisis considering the fact that pip works and i get the package system and the imports running after i did the commands in the pycharm terminal. I'm just looking for a reason as to why it's unable to find the pip in the "normal" cmd versus the pycharm built in terminal.

Have you added Python 3.7 to your PATH (environment variables)? Windows may not be able to access pip or its coupled commands unless you do.
The two methods of accessing the pip version from the Windows Terminal (i.e. CMD) or Windows Powershell are as follows:
pip --version
and
pip -V
Give those two a shot again, and make sure that Python 3.7 is part of your system PATH.

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

Python PIP for absolute beginner (add Paths)

I am NOT a coder. I was trying to follow an online video when I stumbled on the PIP command for python. I have Python 3.9.
In the command prompt, if I type in PIP..I get
'pip' is not recognized as an internal or external command, operable
program or batch file.
Because I TRY to RTFM, another suggestion mentions using python as a command
C:\Users\TL>python get-pip.py
Python was not found; run without arguments to install from the
Microsoft Store, or disable this shortcut from Settings > Manage App
Execution Aliases.
Now I feel stuck. I am just trying write basic python code on a Windows 10 computer.
Any assistance is greatly appreciated.
UPDATE:
Upon futher review, this question is partially answered.
How do I add these paths to bee seen???
C:\Users\TL\AppData\Local\Programs\Python\Python39
C:\Users\TL\AppData\Local\Programs\Python\Python39\Scripts
By now, I have seen it mentioned a few time with no real explanation of where this is added.
ADENDUM:
I followed the instruction from the link below. The paths were added. PIP "Shows" as installed successfully. but the PIP command does not work. See picture
Python 3.4+ comes with pip: you don't need get-pip.py
Generally speaking, unless you've activated a virtualenv (which you haven't), you should prefer to always use python -m pip as you then have full control about which Python you're installing packages into. This is more commonly a problem when you have more than one Python installed
So, you want to use
python -m pip --version
I did not fully understand your problem, but I am assuming that you are using CMD. Check if you added Python to the windows path.
you can follow the steps in this link
https://datatofish.com/add-python-to-windows-path/
It's probably more user-friendly to use a terminal window than a command prompt like Jupyter as an alternative.
However, if you're looking to use Python using your Windows command prompt then you can type in Python3.9 , python or python3. Then, use the pip command to install any Python dependencies and libraries.

'django' is not recognized as an internal or external command, operable program or batch file.(module error)

I have freshly installed python version 3.9 and it shows up in my CMD (command prompt),
but when I try to install django via command
pip install django (also tried sudo doesn't work either)
command line screenshot
but when I try to check my version via
django --version
command line screenshot
I have already tried to configure my environment path variable added every possible path in it.
Environment path variable screenshot
P.S : I don't want to create virtual environment please don't suggest me that the same thing happen's there too. I have been stuck for many days with this problem if anybody actually know how to solve it please help
Let me clear the point that you tried using sudo in your windows machine, I believe that you used Administrator CMD or Administrator Power-shell.
Let's get to the point, from your screenshot it appears you already have the Django library installed in your machine but you are checking django version the wrong way.
You can check the version by using the below command:
python -m django --version
OR
pip freeze
*which will show you all python libraries versions.
please make sure to change python to python3 if this is what you are using, and do the same thing for pip as well
as an optional step you can try to create a project using below command
django-admin startproject testing-project
I hope this help you!, happy coding.

Why cant I find PIP in Command Prompt? [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 2 years ago.
I have recently downloaded python(3.8) as of March 2020 on a Windows 10 machine and went to check my version of Pip. I used pip --version and several other commands but it says "pip is not recognized as an internal or external command, operable program or batch file." I went and looked in the simple search bar in Windows which was able to find pip installed on my computer. So what commands do I need to use to use pip? Or is there something else i'm missing?
Make sure that this folder is added to the path in you environment variables
Pip is Python package installer.
From Python version 3.4 pip suppose to arrive with the regular installation of Python.
Where did you get the Python Installation?
When you install pip the default path suppose to be: C:\Python34\Scripts\pip, is it in there?
As the other user has already wrote - please make sure the the pip folder path is in the PATH enviroment variable in your machine.
You can check it by: WINKEY + PAUSE/BREAK -> Advance system settings Enviroment Variables and then search for Path variable.
Another way to see it is to open CMD and run: echo %PATH%
If the Pip folder is present but the path is not exists in your PATH variable, simply add the Pip path:
setx %PATH%;c:\python34\scripts

I can't use pip (Windows)

I'm wanting to learn machine learning, but it requires that I use 'pip.' I'm still very new to a lot of this stuff. I've installed Python 3.4 64-bit and get-py.py.
When I run pip install sklearn I get 'pip' is not recognized as an internal or external command, operable program or batch file.
Here's a screenshot of my environmental variable PATH
https://gyazo.com/c7ec926401878845d5c4f9a556cf00ee
Any help would be greatly appreciated. I have checked out other posts where people had similar issues, but I tried various things and nothing worked.
Easiest solution is to just download a platform like Anaconda for example. It is Python with many libraries (sklearn, pandas, numpy, ...) and also with pip, all in a user-friendly Windows installer package, that takes care of everything for you.
https://www.continuum.io/downloads
If you really want to do it yourself, then
download get-pip.py (https://bootstrap.pypa.io/get-pip.py)
make sure you have Python installed and in your PATH, for example by running python --version in command prompt
Navigate to the directory, where you downloaded get-pip.py (in command prompt using the command cd).
Run the command python get-pip.py from a command prompt with admin privileges (possibly not needed, but just to make sure).
This should be all. Close your command prompt, open it again and run pip --version to test it. If it doesn't work, then search your computer for a file named pip.exe (most likely in your Python directory) and if you find it, add its path to your PATH variable (given the screenshot, I assume you know how to do this).
I downloaded Python 3.6 and the pip was installed on my system.
I found pip at below location:
C:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts
Also, before I found pip I used below command on my command prompt to install pyperclip:
python -m pip install pyperclip
For anyone that might have installed Python using the MSI installer, and ticked the box to include pip, but still gets the error 'pip' is not recognized as an internal or external command, operable program or batch file:
It looks like that the pip executable is installed in the \Scripts subdirectory of the Python installation, but that directory does not get automatically added to PATH.
For me, since I had installed Python 2.7, the directory was C:\Python27\Scripts. After adding this path to the PATH environment variable, and open a new CMD window, pip was available as a command.
I've made a workaround that will help you, copy the batch script below and modify it as specified:
#"PATH to python.exe" "PATH to pip.exe" %*
For example like this:
#"C:\programming\bin\python374\python.exe" "C:\programming\bin\python374\Scripts\pip.exe" %*
Save this file as pip.bat on Desktop and then move it to C:\Windows\system32.
For Python 3.7 or higher at least (as today is October 4th 2019) in the installation window you need to check the box "add to PATH" when you first install Python.
I'm late now, but just add python to your environment variables.
It´s explained in this short video, how to set up python to your environment variables:
https://www.youtube.com/watch?v=Y2q_b4ugPWk
after that pip should work on your cmd prompt, without cd to
"C:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts"
This is late but in case anyone runs across this issue, pip installed for me as "pip3". Once I used pip3 as my command and not pip, it worked fine. Threw me for quite a loop since I've been using Python for years.
PIP Install and Upgrade
Ensure you are accessing the right location while accessing pip as shown in my link above. Starting Python 3.4, it is included by default with the Python binary installers.
Environment Variable
It is also a good idea to update the environment variable if the path is not accessible by default, once the installation is complete.
If it is specifically pip you want you could install python again making sure to tick the install pip box which it sounds like you failed to upon initial installation.

Categories

Resources