Bash pip command not found windows что делать

I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install but before it even tries to find anyt...

I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install <lib you want> but before it even tries to find anything online I get an error «bash: pip: command not found».

This is on Mac OS X. I’m assuming there’s some kind of path setting that was not set correctly when I ran setup.py. How can I investigate further? What do I need to check to get a better idea of the exact cause of the problem?

EDIT: I also tried installing Python 2.7 for Mac in the hopes that the friendly install process would do any housekeeping like editing PATH and whatever else needs to happen for everything to work according to the tutorials, but this didn’t work. After installing, running ‘python’ still ran Python 2.6 and PATH was not updated.

user's user avatar

user

4,3135 gold badges17 silver badges34 bronze badges

asked Mar 20, 2012 at 2:43

Trindaz's user avatar

8

Why not just do sudo easy_install pip or if this is for python 2.6 sudo easy_install-2.6 pip?

This installs pip using the default python package installer system and saves you the hassle of manual set-up all at the same time.

This will allow you to then run the pip command for python package installation as it will be installed with the system python. I also recommend once you have pip using the virtualenv package and pattern. :)

dda's user avatar

dda

5,9222 gold badges25 silver badges34 bronze badges

answered Mar 20, 2012 at 5:27

klobucar's user avatar

klobucarklobucar

6,3111 gold badge13 silver badges15 bronze badges

6

2020 Update:

For current Debian/Ubuntu, use

apt-get install python3-pip

to install pip3.


Old 2013 answer (easy_install is now deprecated):

Use setuptools to install pip: sudo easy_install pip

(I know the above part of my answer is redundant with klobucar’s, but I can’t add comments yet), so here’s an answer with a solution to sudo: easy_install: command not found on Debian/Ubuntu: sudo apt-get install python-setuptools

Also, for python3, use easy_install3 and python3-setuptools.

For Python 3, use apt-get install python3-pip.

answered Aug 10, 2013 at 20:34

cidermole's user avatar

cidermolecidermole

5,5321 gold badge14 silver badges21 bronze badges

5

First of all: try pip3 instead of pip. Example:

pip3 --version
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)

pip3 should be installed automatically together with Python3.x. The documentation hasn’t been updated, so simply replace pip by pip3 in the instructions, when installing Flask for example.

Now, if this doesn’t work, you might have to install pip separately.

answered Oct 13, 2017 at 8:13

Per Quested Aronsson's user avatar

4

Update: A more reliable modern way to access the right pip install for the right python install is to use the syntax python -m pip.

Original Answer

pip would install itself into the bin of your python installation location. It also should create a symlink to some more common location like /usr/local/bin/pip

You can either edit your ~/.profile and update your PATH to include /Library/Frameworks/Python.framework/Versions/2.6/bin, or you could create a symlink to it in a place that you know is in your path.

If you do: echo $PATH, you should see the paths currently being searched. If /usr/local/bin is in your PATH, you can do:

ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/pip /usr/local/bin

I would opt for adding the python bin to your $PATH variable.

answered Mar 20, 2012 at 2:51

jdi's user avatar

jdijdi

89.2k19 gold badges165 silver badges201 bronze badges

8

I encountered this problem having downloaded python 3.x.x and trying to install awscli — pip: command not found.

Whilst following the instructions for downloading the AWS client, I changed

pip install awscli

to

pip3 install awscli

which ran the correct version.

I’ve made an alias on my machine to run python3 whilst typing python, which would normally run the system version 2.7. I’m not sure this is a good idea now. I think I’ll just type in the commands as they intended them to be.

desertnaut's user avatar

desertnaut

56k21 gold badges133 silver badges163 bronze badges

answered Nov 1, 2014 at 10:05

ness-EE's user avatar

ness-EEness-EE

1,25413 silver badges19 bronze badges

0

Check out How to Install Pip article for more information.

As of 2019,

Download get-pip.py provided by https://pip.pypa.io using the following command:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Run get-pip.py using the following command:
sudo python get-pip.py

After you done installing, run this command to check if pip is installed.
pip --version

Remove get-pip.py file after installing pip.
rm get-pip.py

Pip website

IAMATP On Scratch's user avatar

answered Aug 26, 2019 at 23:52

Jun's user avatar

JunJun

2,8644 gold badges26 silver badges49 bronze badges

1

Install Python latest version as given here

It has many download links like numpy and scipy

Then go to terminal and enter following command:-

sudo easy_install pip

For Python install packages check this

Requirements for Installing Packages
This section describes the steps to follow before installing other Python packages.

Install pip, setuptools, and wheel If you have Python 2 >=2.7.9 or
Python 3 >=3.4 installed from python.org, you will already have pip
and setuptools, but will need to upgrade to the latest version:

On Linux or OS X:

pip install -U pip setuptools On Windows:

python -m pip install -U pip setuptools If you’re using a Python
install on Linux that’s managed by the system package manager (e.g
“yum”, “apt-get” etc…), and you want to use the system package manager
to install or upgrade pip, then see Installing pip/setuptools/wheel
with Linux Package Managers

Otherwise:

Securely Download get-pip.py 1

Run python get-pip.py. 2 This will install or upgrade pip.
Additionally, it will install setuptools and wheel if they’re not
installed already.

answered Jun 28, 2017 at 4:45

Ashish P's user avatar

Ashish PAshish P

1,4531 gold badge20 silver badges28 bronze badges

0

I spent ages going through all the answers on this page but found the one that worked for me in the comments of the OP question by s-walsh

The answer is to use pip3:

$ pip3 install <name-of-install>

answered Dec 26, 2019 at 23:30

cfranklin's user avatar

cfranklincfranklin

1,4801 gold badge13 silver badges14 bronze badges

0

Installing using apt-get installs a system wide pip, not just a local one for your user. Try this command to get pip running on your system …

$ sudo apt-get install python-pip python-dev build-essential

Then pip will be installed without any issues and you will be able to use «sudo pip…».

Mubashar Abbas's user avatar

answered Aug 11, 2016 at 6:16

Vignesh's user avatar

VigneshVignesh

1,4911 gold badge12 silver badges11 bronze badges

2

Most of the methods to install PIP are deprecated. Here is the latest (2019) solution. Please download get-pip script

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Run the script

sudo python get-pip.py

answered May 2, 2019 at 10:02

mixdev's user avatar

mixdevmixdev

2,6842 gold badges29 silver badges25 bronze badges

1

Latest update 2021.

In Ubuntu 20 64bit works perfectly

Installation of python3

sudo apt install python3

Pip Installation

sudo apt install python3-pip

Add following alias in $HOME/.bash_aliases in some cases file may be hidden.

alias pip="/usr/bin/python3 -m pip "

Refresh current terminal session.

. ~/.profile

  • check pip usage: pip
  • Install a package: pip install {{package_name}}

extra info

to get Home path

echo $HOME

you will get your home path.

answered Oct 20, 2020 at 3:12

dipenparmar12's user avatar

dipenparmar12dipenparmar12

2,7901 gold badge30 silver badges37 bronze badges

To solve:

  1. Add this line to ~/.bash_profile:

    export PATH="/usr/local/bin:$PATH"
    
  2. In a terminal window, run

    source ~/.bash_profile
    

desertnaut's user avatar

desertnaut

56k21 gold badges133 silver badges163 bronze badges

answered Mar 20, 2012 at 4:14

Trindaz's user avatar

TrindazTrindaz

16.6k21 gold badges80 silver badges111 bronze badges

2

It might be the root permission. I tried exit root login, and use

sudo su -l root
pip <command>

desertnaut's user avatar

desertnaut

56k21 gold badges133 silver badges163 bronze badges

answered Aug 13, 2015 at 16:04

Jay0Lu's user avatar

Jay0LuJay0Lu

3182 silver badges8 bronze badges

install Homebrew, open Terminal or your favorite OSX terminal emulator and run

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

insert the Homebrew directory at the top of your PATH environment variable. You can do this by adding the following line at the bottom of your ~/.profile file

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

Now, we can install Python 2.7:

$ brew install python

Get pip repository:

$ git clone https://github.com/pypa/pip

install pip:

$sudo easy_install pip

answered Jul 19, 2016 at 15:34

Aden Yee's user avatar

Aden YeeAden Yee

991 silver badge1 bronze badge

1

python install it by default but if not install you can install it manual use following cmd (for linux only )

for python3 :

sudo apt install python3-pip 

for python2

sudo apt install python-pip 

hope its help.

answered Aug 5, 2019 at 10:15

Krishna Jangid's user avatar

Krishna JangidKrishna Jangid

4,5415 gold badges25 silver badges33 bronze badges

If you are running Python 3.5, run the following terminal command:

sudo pip3 install -U nltk

Any other pip commands in terminal would be similar:

pip3 install --upgrade pip
sudo pip3 install -U numpy ::

Gandhi's user avatar

Gandhi

11.9k4 gold badges41 silver badges63 bronze badges

answered May 6, 2016 at 6:31

Eric Pierre's user avatar

It solved my problem by using

sudo easy_install pip

desertnaut's user avatar

desertnaut

56k21 gold badges133 silver badges163 bronze badges

answered Jun 15, 2020 at 1:19

BlueJapan's user avatar

BlueJapanBlueJapan

1,0262 gold badges13 silver badges16 bronze badges

Solved this by upgrading python 3 brew upgrade python:
Now i can just do:

pip3 install  <package>  

==> python
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have 

blackchestnut's user avatar

answered Jul 27, 2019 at 17:21

z atef's user avatar

z atefz atef

6,7523 gold badges51 silver badges48 bronze badges

Based on this stackoverflow answer and some of the answers on this thread, I have created an alias in the rc file:
alias pip="python3 -m pip"

There seem to be many different answers to this question but this seems to be the best-practice approach.

answered Aug 31, 2020 at 16:34

papiro's user avatar

papiropapiro

2,07818 silver badges28 bronze badges

Avoiding sudo:

python <(curl https://bootstrap.pypa.io/get-pip.py) --user
echo 'export "PATH=$HOME/Library/Python/2.7/bin:$PATH"' >> ~/.bash_profile

From:

http://www.pip-command-not-found.com

answered Jan 23, 2018 at 15:47

mxcl's user avatar

mxclmxcl

26.1k12 gold badges98 silver badges98 bronze badges

1

CentOS 7 users can just use:

yum install python-pip

Also recommend using virtualenv if you’re using pip. It can be added in the same way:

yum install python-virtualenv

answered Oct 19, 2018 at 17:28

Felipe's user avatar

FelipeFelipe

9,7564 gold badges36 silver badges51 bronze badges

1

assuming you have internet see:
https://pip.pypa.io/en/stable/installing/

basically run:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

and

python get-pip.py

answered Feb 17, 2020 at 13:35

Nahshon paz's user avatar

Nahshon pazNahshon paz

3,5452 gold badges19 silver badges28 bronze badges

Try using this. Instead of zmq, we can use any package instead of zmq.

sudo apt-get install python3-pip
sudo apt-get update
python3 -m pip install zmq

I was was not able to install this zmq package in my docker image because of the same issue i was getting. So tried this as another way to install and it worked fine for me.

answered Oct 16, 2020 at 5:47

Bipin B's user avatar

To overcome the issue bash: pip: command not found in Mac

Found two versions on Mac 1 is 2.7 and the other is 3.7

  • when I say sudo easy_install pip, pip got installed under 2.7

  • when I say sudo easy_install-3.7 pip, pip got installed under 3.7

But, whenever I would require to do pip install , I wanted to install the package under python3.7, so I have set an alias (alias pip=pip3) in .bash_profile.

so now, whenever I do pip install <package_name>, it gets installed under python3.7

desertnaut's user avatar

desertnaut

56k21 gold badges133 silver badges163 bronze badges

answered Mar 15, 2020 at 20:50

Ramakrishna Nimmathota's user avatar

(Context: My OS is Amazon linux using AWS. It seems similar to RedHat but it’s stripped down a bit, it seems.)

Exit the shell, then open a new shell. The pip command now works.

That’s what solved the problem at this location.

You might want to know as well: The pip commands to install software then needed to be written like this example (jupyter for example) to work correctly on my system:

pip install jupyter —user

Specifically, note the lack of sudo, and the presence of —user

Would be real nice if pip docs had said anything about all this, but that would take typing in more characters I guess.

answered Nov 6, 2016 at 14:10

Geoffrey Anderson's user avatar

Not sure why this wasnt mentioned before, but the only thing that worked for me (on my NVIDIA Xavier) was:

sudo apt-get install python3-pip

(or sudo apt-get install python-pip for python 2)

answered Feb 1, 2019 at 0:32

DankMasterDan's user avatar

DankMasterDanDankMasterDan

1,7203 gold badges21 silver badges33 bronze badges

1

apt -y -qq install python3 python3-pip
ln -s /usr/bin/python3 /usr/bin/python
ln -s /usr/bin/pip3 /usr/bin/pip

answered Nov 17, 2020 at 16:26

lockwise's user avatar

lockwiselockwise

531 silver badge5 bronze badges

What I did to overcome this was sudo apt install python-pip.

It turned out my virtual machine did not have pip installed yet. It’s conceivable that other people could have this scenario too.

Nino Filiu's user avatar

Nino Filiu

15k10 gold badges53 silver badges77 bronze badges

answered Jul 13, 2018 at 1:14

Connor's user avatar

ConnorConnor

3,9262 gold badges27 silver badges40 bronze badges

1

The updated command for installing pip3 is :

sudo apt-get install python3-pip

exploitr's user avatar

exploitr

8401 gold badge15 silver badges27 bronze badges

answered Apr 27, 2020 at 19:16

repleeka's user avatar

repleekarepleeka

4925 silver badges14 bronze badges

The problem seems that your python version and the library yoıu want to install is not matching versionally. Ex: If Django is Django3 and your python version is 2.7, you may get this error.

«After installing is running ‘python’ still ran Python 2.6 and PATH was not updated.»

1- Install latest version of Python
2- Change your PATH manually as python38 and compare them.
3- Try to reinstall.

I solved this problem as replacing PATH manually with the latest version of Python.
As for Windows: ;C:python38Scripts

answered May 30, 2020 at 5:25

Voontent's user avatar

VoontentVoontent

6795 silver badges7 bronze badges

Let’s say you receive an error message from Git Bash.

bash: pip: command not found

What Is a Pip Command Not Found Error?

A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.

And an error message from DOS command line.

'pip' is not recognized as an internal or external command,
operable program or batch file.

What do you do? 

How to Fix Pip Command Not Found

If you’ve just installed Python, you may want to rerun your Python installer and make sure you check the box “Add Python 3.6 to PATH.”

pip command not found Python installer image

Python for Windows installer page. | Screenshot: Ashley Gelwix

If not, don’t worry. You can add Python and the pip directory to the PATH in a bit. Next, check here for pip3.exe:

C:UsersYOUR_USERNAMEAppDataLocalProgramsPythonPython36Scripts

Note that you can’t copy and paste that line. You will need to fill in your actual username in that path.

If you do find “pip 3,” you are in luck. It should look something like the image below.

pip command not found pip3 folder screenshot

The pip3.exe folder on Windows. | Screenshot: Ashley Gelwix

If you’re navigating on Windows, you can easily get to the AppData folder by typing the %appdata% macro into the path bar in a Windows File Explorer (formerly Windows Explorer) window.

pip command not found AppData search screenshot

Search %appdata% to get to the appdata folder on Windows. | Screenshot: Ashley Gelwix

If you can’t find the pip3.exe, it might not be installed. So, the first thing you should do is check to see that you did install pip. Run your Windows Python installer again and check the optional features page to ensure you marked the “pip” box. It’s easy to pass over these little things, and you may have missed it the first time through.

pip command not found python installer optional features

Check the install pip checkbox. | Screenshot: Ashley Gelwix

First, check that you’ve got the “pip” checkbox marked.

pip command not found advanced options screenshot

Mark “Add Python to environment variables” in advanced options. | Screenshot: Ashley Gelwix

Add Python to environment variables so that the Scripts folder with pip3.exe in it can be found. Then make sure that you’ve checked the box for adding Python to environment variables.

More on Coding ErrorsHow to Prevent Kubernetes Configuration Errors

How to Install Pip on the Command Line

If you don’t want to run your Python installer again, you can just install pip on the command line. 

It is also quite possible that you may have skipped over this warning right after summoning Python from the command line or after installation.

WARNING: The scripts pip.exe, pip3.6.exe and pip3.exe are installed in 'C:UsersYOUR_USERNAMEAppDataLocalProgramsPythonPython36Scripts' which is not on PATH.
 Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

It’s easy to miss, and I think developers get into the habit of ignoring warnings like this because code often compiles with thousands of compiler warnings. 

Now, let’s edit your path. Start by searching for “environment” in your Windows search tab.

pip command not found environment variables screenshot

Search “environment” and edit the environment variables. | Screenshot: Ashley Gelwix

Then select, “Edit the system environment variables.”You will see a window like this below.

pip command not found system properties screenshot

In system properties, select environment variables. | Screenshot: Ashley Gelwix

Click the button the green arrow is pointing to labeled “Environment Variables.”

pip command not found environment variables path

Select the Path you want to edit. | Screenshot: Ashley Gelwix

You will then have a choice. You can either edit the user path or the system path. 

I usually edit the system path and have never run into issues. However, I suspect that the safer thing to do, the more “principle-of-least-privilege” thing to do, would be to edit the user path. That way only the user who needs pip access will have it. It’s up to you, but I typically never have more than one user on my machine. However, many workplaces do.

pip command not found edit paths screenshot

Click the Edit button for whichever path you chose

From there, you’ll want to copy the path we discussed earlier.

C:UsersYOUR_USERNAMEAppDataLocalProgramsPythonPython36Scripts

Make sure you use your actual username in the place of YOUR_USERNAME. Remember, you can’t just copy paste it. While you’re here, it’s also not a bad idea to add Python to your path. So, add this folder, too. It’s just one level up:

C:UsersYOUR_USERNAMEAppDataLocalProgramsPythonPython36

If you can’t open the path in File Explorer, it’s not a real path.

pip command not found edit environment variable screenshot

Paste in the Path and click OK. | Screenshot: Ashley Gelwix

Once you’ve pasted in the new path to the end of the path system environment variable, you can click OK to close the window. 

Next you need to restart the terminal, and type in “pip” to check your work. If it works, you should see the help output in the terminal. It should look something like the image below.

pip command not found help output in terminal screenshot

Pip help output in terminal. | Screenshot: Ashley Gelwix

If you don’t see it, you should go back to your path environment variable and make sure it is correct. Watch out for spaces in the wrong place, extra characters, etc.

More on PythonPython Tuples vs. Lists: When to Use Tuples Instead of Lists

The example path I gave you is on the C:/ drive. If you installed pip and Python to a different drive, use that one instead.

Alternatively, you could do this in your ~/.bashrc file for Git Bash. Enter, vim ~/.bashrc to open the bashrc file. This is a file that executes every time you open a shell window. You’ll have to re-open your shell to get the changes that you make to the bashrc file.

alias pip='C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python36\pip3.exe'

A few other things to note:

  • You MUST use single quotes as double quotes will not work.
  • You MUST escape your slashes.
  • You MUST use Windows style slashes (). Unix style (/) will not work.
  • You MUST escape your spaces in the path. If YOUR_USERNAME has a space you would enter the following: 
    alias pip='C:\Users\YOUR USERNAME\AppData\Local\Programs\Python\Python36\Scripts\pip3.exe'

This can be handy if you don’t think you should edit the path. There’s more than one way to crack an egg. Creating an alias will just make pip automatically call that pip3.exe you pointed it to. However, you may need to add the “Scripts” folder to the path in order to find some modules you installed. 

On Windows especially, it seems to nearly always be safe to append to the path. But I always do that little trick to make sure I have an alias around just in case.



07 Nov, 22



by Susith Nonis



3 min Read

How to fix the pip command not found error? [Solution]

List of content you will read in this article:

  • 1. What is PIP? [Definition]
  • 2. How to fix «bash: pip command not found» error? [Methods]
  • 3. Conclusion

PIP is a Python dependency and library package manager. It is typically installed alongside Python 3x and Python 2x. However, in rare cases, you may encounter the «pip command not found» error while installing a library or python package. This article will cover the causes of this error and simple solutions for resolving it. The methods discussed here apply to both Linux operating systems and Windows users.

What is PIP? [Definition]

PIP is a package manager for Python packages. It helps the users install and manage different Python packages and frameworks. Pip is installed along with Python from Python versions 3.4 and above. Pip is similar to the package managers of Linux Operating Systems like apt-get, yum, etc. 

How to fix «bash: pip command not found» error? [Methods]

Solution 1: Install Python

As we mentioned, from Python 3.4, we know how to install pip along with Python. Therefore, we can try installing Python on the machine to eliminate this error.

Step 1: Visit the official webpage to install Python on your machine. There, you will see different Python versions available for download. Choose a suitable package and download the executable installer.

Step 2: Once the executable file is downloaded, open the file by going to the Download folder, double-click on the file to start the installation process, and click «Install Now» to start the installation process.

Once Python is installed, you will see the below window in the installer.

Step 3: To verify the pip installation, enter the pip -v command in the Command Prompt to see the pip version.

Step 4: To install Python on Debian based Linux distributions, download Python from the same official website and enter the following command in the terminal:

$ sudo apt-get install python3.8

Once Python is installed, you can verify the installation of python using the command below.

python --version

Solution 2: Use easy_install

If you are using Python 2, you need to install pip separately. Execute the following command in Linux to get pip for Python 2x versions.

$ sudo easy_install pip

Solution 3: Use pip3 instead of pip

You could also specify the version of pip as normal pip command may not work with Python 3x in some cases. For this, use pip3 instead of pip while installing a package.

Conclusion

We went over the solutions to the how-to resolve «pip command not found» error in this article. We discovered several possible causes for this problem, which can be resolved by installing Python from scratch, installing a different version of pip, or specifying the pip version when installing the packages. If you feel we can have other alternatives, you can suggest them in the comment box below.

You can buy our Debian VPS server to work with a Debian server for more security.

Keep reading.

People also read: 

  • What is the use of Python
  • Python Cheat Sheet 
  • How to install Python on Windows
  • How to update the Python version 
  • How to learn Python 

If you are a developer either pro or novice and getting «Pip command not found error«. You have landed on the right page to find the solution. Majorly the reason is either you have not installed pip or the environment variable of pip is not set correctly. Based on the operating system, look for step by step solution to fix your pip command error.

Table of Contents

  • 1 What are the common errors, related to pip?
  • 2 What are the quick fixes for «pip command not found error»?
  • 3 What are Python and pip?
  • 4 How to fix pip command not found error in Ubuntu Linux
  • 5 How to fix ‘pip’ is not recognized as an internal or external command, operable program or batch file in Windows 10
  • 6 Solution4 — Setup the python Environment variable in Windows 10, in case forgot to select the option during installation
  • 7 Solution5 — Permission issues, exit root login to fix «pip command not found error»
  • 8 Conclusion

Below mentioned are very common errors you may encounter while working with Python and based on your operating system.

  1. Bash: pip: command not found
  2. Sudo pip command not found in Ubuntu
  3. Pip command not found in mac
  4. ‘pip’ is not recognized as an internal or external command, operable program or batch file
  5. pip command not found in Windows
  6. pyenv pip command not found
  7. pip command not found mac python 3
  8. zsh: command not found: pip

What are the quick fixes for «pip command not found error»?

  • Check for the existing installation of Python and pip versions in your system. Also, try the pip3 command instead of the pip
  • If pip is not installed, then install pip in the right way
  • If pip is installed, then make sure you have Path or environment variable set up correctly
  • Validate whether you are running python2 or python3 code and select your pip version accordingly. The recommendation is to move the codebase to Python and pip3 as Python2 is obsolete now.
  • Reinstall or upgrade Python and pip both, in case still getting pip command not found error
  • Exit out of the root user and run the pip command

What are Python and pip?

Python is a simple, Object-oriented, interpreted, high-level programming language with dynamic semantics. Due to its non-complicated syntax and fast edit-test-debug cycle, the Programmer community loves it. Python also reduces the cost of software management due to its simple nature. Python2 and Python3 are the two versions available, while Python2 is already obsolete and it’s suggested to move your codebase to Python3.

Pip is a package manager for python, it allows you to install and manage additional libraries and dependencies that are not distributed or part of the standard library.

*** For Windows10 and macOS, pip gets installed automatically with python3 as an option is available during installation. But in the case of Linux, you need to install pip3 after python3 installation separately.

If you are getting «bash: pip command not found error» in Ubuntu or any other Linux distro. You can fix it easily by following methods —

Solution 1- Check Whether Python and Pip are installed already or not?

I will take Ubuntu as a Linux distro for this post —

1.1 — Open Terminal in Ubuntu

Press <Ctrl + Alt + t> on your keyboard to open terminal.

1.2 — Check for the Python version installed in your Linux system

  • For python2. Python 2 is obsolete and it is recommended to move your codebase to python3.
$ python --version 
  • For Python3 which is by default installed in Ubuntu 20.04 or Ubuntu 21.04. In all new Linux distros, you get Python installed by default.
$ python3 --version

check-python3-version

In my case, Python 3.8.5 is installed by default. Visit my other article if you want to install the latest python and pip in Ubuntu Linux.

1.3 — Check for the existing pip version in Ubuntu 21.04

Run pip —version command to check, whether pip is also installed. Try running both commands, generally pip3 works in most cases.

$ pip --version 

OR

$ pip3 --version

pip command not found error

As you can see, I have got command ‘pip’ not found error. Because I have python 3 installed by default but not pip. So in Ubuntu make sure you always install pip as it’s not available by default.

  • To install pip you can simply run —
$ sudo apt update

$ sudo apt install python3-venv python3-pip

Check out this post, in case you get the sudo: command not found error. Once you are done with the installation, check the pip version again. Now you will not get the «pip command not found error» as it has been fixed already.

For alternate pip installation methods, you can refer to this official guide also.

1.4 (Optional) — Setup alias of pip3 as pip if required

In the case of Linux, you get pip and pip3 commands both after installing Python and Pip. If this is not the case, creating an alias is the only solution.

Add the following alias in $HOME/.bash_aliases in some cases, files may be hidden. You can also create it, in the case file doesn’t exist. Here option -m stands for the Module name.

alias pip="/usr/bin/python3 -m pip "

Refresh current terminal session

$ . ~/.profile

Solution2 — Setup path variable in Linux or macOS, in case pip3 is installed but still getting pip error

The path variable is set up by default during pip installation, but in case it doesn’t. Follow these steps to set up path variables in Linux or macOS.

  • Add this line to ~/.bash_profile using vi or nano editor.
export PATH="export PATH=/usr/bin/:/usr/local/bin:/usr/local/sbin:$PATH"
  • In a terminal window, run
source ~/.bash_profile

In the case of macOS, if you are using the zsh shell, then you can add it into the «.zshrc» file. Check out my other article, in case you get the zsh command not found error.

How to fix ‘pip’ is not recognized as an internal or external command, operable program or batch file in Windows 10

If you are getting the «pip command not found error» in Windows 10, follow these steps —

Solution3 — Install Pip during Python3 installation and setup path variable automatically

Step3.1- Python and pip download

You can download the latest python version 3.9.1 for windows or your respective operating system from the python.org website.

Download-python-3.9

Otherwise, you can simply click on the below-mentioned button to download python for windows 10.

Click here to download an older release of Python like 3.8 or 2.7, for your project. Once you click on this link, scroll down and select your old python version as shown in the image.

Download-old-python-releases

You don’t need to download pip separately as it’s part of Python 3.9.1 software. You will know it while following this post further.

Step3.2- Run Python 3.9.1 (64-bit) installer

Once your download completes, visit your «download» directory. Then double click python-3.9.1-amd64 file to start the python setup wizard.

Run-python-exe

Step3.3- Choose «Install Now» or «Customize» installation

At this point, You will get two installation options —

  1. Install Now — This option is helpful if you are a newbie. Just select «Install now» and it will install Python 3.9 with default settings. Python default installation directory would be «C:users»your-username»AppDataProgramsPythonPython39». It will also install IDLE, pip, documentation and shortcuts.
  2. Customize installation — If you are a pro and need to know, what all features will be installed with python. Also, in case you already have python installed and want to test the latest version. Using the Customize installation option, you can choose a different installation folder and can keep both python versions.

Keep following this post, if you want to see options covered in Customize installation.

how-to-install-python-on-windows

There are two more checkboxes to look into —

  • «Install launcher for all users (recommended)» — Select this check box and it will make a python launcher shortcut for all user profiles that exist on your machine. Whomsoever will login to your system will be able to use python 3.9.
  • Add python 3.9 to the path — Select this check box to add Python and pip «Path Variables» in the system environment automatically. If you will not select this option now, you need to add the path variable manually later after installation. My recommendation is to select it here itself.

Step3.4- Add or remove «Optional Features«

On this window, you can add or remove optional features, available with python 3.9. Let’s see a few details of each optional feature available —

  • Documentation:- Selecting this box will install all the Python documentation and manuals.
  • pip:- As I informed you in Step 1 download section. Pip is already part of python 3.9. Select this check box, If you want to install pip automatically with Python 3.9 (which I strongly recommend).
  • tcl/tk and IDLE:- Selecting this check box will install Tkinter and the IDLE development environment. You don’t need to install it separately then.
  • Python test suite:- Installs the standard library suite.
  • py launcher for all users (requires elevation):- Installs the global ‘py launcher for all users. It requires admin rights (elevation) to perform it. Because it will allow all users to launch python easily from their user profiles.

Choose your required optional features and click Next. I will suggest you keep all options checked.

select-optional-features-python

  • Select Next and complete the installation with default options.

Step3.5- Validate Python and pip versions

  • Open the elevated command prompt «as administrator» by typing «cmd» in the search bar of Windows 10.

open-command-prompt-windows10

  • Run the python or py (short form) command to check the Python version. You can see its version 3.9.1 installed in my case. You will see your installed version.
C:> py 
### OR ###
C:> python

How-to-check-python-version

Type exit() or press «Ctrl + Z» on your keyboard to exit from the python prompt.

  • To check the Python-pip version, type the pip —version command. it will show you the pip version. it’s pip 20.2.3 in my case.
C:> pip --version

check-pip-version

Running the pip and python version command successfully also validates, that your python and pip path variables are added successfully in windows 10.

Solution4 — Setup the python Environment variable in Windows 10, in case forgot to select the option during installation

It’s very common to ignore options during the installation of any software in Windows 10. So if you are getting a «pip command not found» error in Windows 10, while you already have Python and pip installed. Then setting the environment up variables can fix this error.

Follow these steps —

  1. Search for environment variables in Windows 10 search box and select «Edit environment variables»
  2. Click Open
  3. Select the «Environment variables» tab
  4. Click on «PATH» in system variables and choose the «Edit» button.
  5. Click New
  6. Add this path, replace «Your_Username» with your user and Python39 with the python version, you have installed.
C:UsersYOUR_USERNAMEAppDataLocalProgramsPythonPython39Scripts

In my case, this path would be —

C:UsersdevenderAppDataLocalProgramsPythonPython39Scripts

  • Save and close all open Windows of environment variable
  • Open a command prompt and run the pip —version command as shown in step 3.5 above. It will fix your issue of «pip’ is not recognized as an internal or external command, operable program or batch file in Windows 10«.

Refer to this image for further details —

Add pip path variable

Solution5 — Permission issues, exit root login to fix «pip command not found error»

$ sudo su -l root

Then run the pip command, you will not get the «pip command» errors.

pip <command>

Conclusion

Generally, pip is available with Python in all the latest versions for Windows. For Linux Python is installed by default, you just need to install the pip version.

If you have installed Python correctly, then the pip command not found error is rare. But if you are still having this error, I hope you would be able to fix it by following this article.

Let me know via your comments, in case you still face any issues, I will try to get this solved.

Pip is a recursive acronym for either “Pip Installs Packages” or “Pip Installs Python.” Alternatively, pip stands for “preferred installer program.” Basically, it is a package manager that allows you to download and install packages. If you try to install packages without pip installed, you will get an error pip: command not found.

In this article, we will look at the cause of this error and possible solutions to fix this error which you are encountering.

Also, Checkout How to resolve python is not recognized as an internal or external command

The issue differs based on the environment and the os which you are using. Let’s understand how the pip is packaged into different environments.

Error Message from Bash:

bash: pip: command not found

Error Message from DOS command line:

'pip' is not recognized as an internal or external command,
operable program or batch file.
  1. Linux – If you have installed Python on a Linux environment, the pip does not come with Python, and you need to install pip package manager as a separate package. Hence in Linux, if you try to install a package, you will get a pip: command not found error as there is no pip package installed.
  2. Mac – On a mac, if you install the latest version of Python 3.x, you don’t have to worry about installing it separately. It comes shipped with Python distributable.
  3. Windows – On windows again, you don’t have to install the pip separately. It comes with Python distributable.

As you already know, Python 2 has reached the end of life, which means it is no longer actively maintained and supported. If you are still using Python 2, then you should consider moving it to Python 3 and it comes with pip3.

How to check if pip is installed correctly?

The first and foremost thing to do is to check if you have already installed pip in your machine. In windows, you can check if the pip is located in the below directory. So just navigate to the directory and do check for pip.exe or pip3.exe files. If it’s not present, then you need to install it.

Check here for pip3.exe:

C:UsersYOUR_USERNAMEAppDataLocalProgramsPythonPython36Scripts

Note: Replace the YOUR_USERNAME with your actual username.

Installing pip the right way

1) On windows, run your Python installer once again and ensure you check the install pip checkbox in the wizard as shown in the below image.

Install Pip On Windows

Install pip on windows

2) On Linux, you can install pip3 by running an apt-get command in your terminal.

sudo apt-get -y install python3-pip

Once you have run this command, you should use the pip3 package manager commands to download the packages. 

3) On Mac, pip is bundled with the Python distributable, so you need to re-install Python once again by executing the below command. Once you have re-installed Python 3, you should be able to execute pip commands.

brew install python3

Installing pip for Python 2

If you are still working on Python 2 and want to install an older version of a pip, you can install it by running the below command on your Linux machine.

sudo easy_install pip

This command installs the pip command onto your system. If you do not already have easy_install installed, install it using the following Linux command:

sudo apt-get install python-setuptools

Avatar Of Srinivas Ramakrishna

Srinivas Ramakrishna is a Solution Architect and has 14+ Years of Experience in the Software Industry. He has published many articles on Medium, Hackernoon, dev.to and solved many problems in StackOverflow. He has core expertise in various technologies such as Microsoft .NET Core, Python, Node.JS, JavaScript, Cloud (Azure), RDBMS (MSSQL), React, Powershell, etc.

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

By checking this box, you confirm that you have read and are agreeing to our terms of use regarding the storage of the data submitted through this form.

Содержание

  1. bash pip command not found
  2. 1. Подключение через SSH и выполнение обновления системы
  3. 2. Убедитесь что pip установлен на сервере Debian 9
  4. 3. Установка pip на Debian 9
  5. 4. Установка pip для версии Python 3.5+
  6. 5. Проверка установки pip
  7. 6. Используйте флаг справки для получения дополнительной информации
  8. python 2.7: cannot pip on windows «bash: pip: command not found»
  9. UPADTE:
  10. 8 Answers 8
  11. bash: pip: команда не найдена
  12. Bash: pip: команда не найдена
  13. ОТВЕТЫ
  14. Ответ 1
  15. Ответ 2
  16. Ответ 3
  17. Ответ 4
  18. Ответ 5
  19. Ответ 6
  20. Ответ 7
  21. Ответ 8
  22. Ответ 9
  23. Ответ 10
  24. Ответ 11
  25. Ответ 12
  26. Ответ 13
  27. Ответ 14
  28. Ответ 15
  29. Ответ 16
  30. Ответ 17
  31. Ответ 18
  32. Ответ 19
  33. Ответ 20
  34. Ответ 21
  35. Ответ 22
  36. python 2.7: не удается pip в windows » bash: pip: команда не найдена»
  37. UPADTE:
  38. 7 ответов

bash pip command not found

Kak ustanovit pip na Debian

1. Подключение через SSH и выполнение обновления системы

Перед тем, как установить pip на сервере Debian 9, подключитесь к серверу через SSH и выполните следующие команды для обновления системного программного обеспечения до последней версии:

После того, как пакеты обновлены до даты вы можете переходить к следующему шагу.

2. Убедитесь что pip установлен на сервере Debian 9

Чтобы проверить, установлен ли pip на сервере, выполните следующую команду:

Если pip не установлен на вашем Debian 9 VPS, вы должны получить выход, как показано ниже:

3. Установка pip на Debian 9

Чтобы установить pip, выполните следующую команду:

Установка займет несколько секунд, в зависимости от скорости соединения. После его завершения, выполните ту же команду, чтобы убедиться, что pip установлен успешно:

Теперь, выход будет аналогичен приведенному ниже:

4. Установка pip для версии Python 3.5+

Если вы используете Python 3.5+, вам необходимо установить pip с помощью следующей команды:

5. Проверка установки pip

Для того, чтобы убедиться, что установка прошла успешно, выполните следующую команду:

Вывод должен быть аналогичен приведенному ниже:

Поздравляем, теперь вы можете использовать pip для установки и управления пакетами программного обеспечения Python для вашего следующего проекта. Для получения дополнительных сведений о том, как использовать pip, вы можете обратиться к документации pipа (https://pip.pypa.io/en/stable/).

6. Используйте флаг справки для получения дополнительной информации

Для Python 3 выполните следующую команду:

Основной синтаксис pip заключается в следующем:

Так, например, чтобы перечислить все установленные модули Python вы должны использовать флаг list :

Для Python 3 команда будет выглядеть так:

Вывод покажет вам, какие модули в настоящее время установлены в вашей системе наряду с правильной версией.

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

Это в Mac OS X, в котором я тоже новичок, поэтому я предполагаю, что какой-то параметр пути был установлен неправильно, когда я запустил setup.py. Как я могу продолжить исследование? Что мне нужно проверить, чтобы лучше понять точную причину проблемы?

EDIT: Я также попытался установить Python 2.7 для Mac в надежде, что дружественный процесс установки будет заниматься любой домашней работой, как редактирование PATH, и что еще нужно, чтобы все работало в соответствии с учебниками, но это не сработало. После установки запущен «python», все еще запущен Python 2.6, а PATH не обновлялся.

Это устанавливает протокол, используя стандартную систему установки пакета python и одновременно сохраняет все ручные настройки вручную.

Это позволит вам запустить команду pip для установки пакета python, поскольку она будет установлена ​​вместе с системным python. Я также рекомендую, если у вас есть пипс, используя virtualenv пакет и шаблон.:)

Используйте setuptools для установки pip :

(Я знаю, что вышеприведенная часть моего ответа избыточна с klobucar, но я не могу добавлять комментарии еще), так что вот ответ с решением для sudo: easy_install: command not found на Debian/Ubuntu:

Прежде всего: попробуйте pip3 вместо pip. Пример:

pip3 должен быть установлен автоматически вместе с Python3.x. Документация не была обновлена, поэтому просто установите pip на pip3 в инструкции, например, при установке Flask.

Теперь, если это не сработает, вам, возможно, придется установить pip отдельно.

Установите последнюю версию Python, как указано здесь

В нем много ссылок на скачивание, например numpy и scipy

Затем перейдите к терминалу и введите следующую команду: —

Для пакетов установки Python проверьте это

Требования к установке пакетов В этом разделе описаны действия, которые необходимо выполнить перед установкой других пакетов Python.

Установить pip, setuptools и wheel Если у вас есть Python 2 >= 2.7.9 или Python 3 >= 3.4, установленный с python.org, у вас уже будет пип и setuptools, но нужно будет обновить до последней версии:

I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install
but before it even tries to find anything online I get an error «bash: pip: command not found».

This is on Mac OS X, which I’m new too, so I’m assuming there’s some kind of path setting that was not set correctly when I ran setup.py. How can I investigate further? What do I need to check to get a better idea of the exact cause of the problem?

EDIT: I also tried installing Python 2.7 for Mac in the hopes that the friendly install process would do any housekeeping like editing PATH and whatever else needs to happy for everything to work according to the tutorials, but this didn’t work. After installing is running ‘python’ still ran Python 2.6 and PATH was not updated.

Источник

python 2.7: cannot pip on windows «bash: pip: command not found»

I am trying to install the SciPy stack located at https://scipy.org/stackspec.html [I am only allowed 2 links; trying to use them wisely]. I realize that there are much easier ways to do this, but I think there is a lot to be learned by doing it manually. I am relatively new to a lot of this stuff, so I apologize if I sound ignorant at any point.

Installed matplotlib : matplotlib-1.3.1.win32-py2.7.exe from (MATPLOTLIB DOT ORG LINK REMOVED)

Does the path on which I saved pip_install.py matter?

6. HERE IS WHERE I FAIL

Attempted to install matlibplot dependency dateutil: Opened a Cygwin Shell, and typed

This results in the error:

Any help is appreciated; the closest I found was bash: pip: command not found. But the OSX nature of it is just enough to confise me further.

UPADTE:

You can see that there is no output or feedback from the shell (which I think there should be). Then when I go to a new python shell:

YVheF

8 Answers 8

So you’ll need to add that to your system path in order to run it from the command prompt. You could alternatively cd into that directory each time, but that’s a hassle.

See the top answer here for info on how to do that: Adding Python Path on Windows 7

As long as pip lives within the scripts folder you can run

This will tell python to get pip from inside the scripts folder. This is also a good way to have both python2.7 and pyhton3.5 on you computer and have them in different locations. I currently have both python2 and pyhton3 installed on windows. When I type python it defaults to python2. But if I type python3 I can use python3. (I also had to change the python.exe file for python3 to «python3.exe»)If I need to install flask for python 2 I can run

and it will be installed in the pyhton2 folder, but if I need flask for python 3 I run:

Источник

bash: pip: команда не найдена

Это на Mac OS X, и я тоже новичок, так что я предполагаю, что есть какая-то настройка пути, которая не была установлена ​​правильно, когда я запустил setup.py. Как я могу расследовать дальше? Что мне нужно проверить, чтобы лучше понять точную причину проблемы?

Правка: Я также пытался установить Python 2.7 для Mac в надежде, что процесс дружественной установки подойдет любому домашнему хозяйству, например редактированию PATH, и тому, что еще нужно, чтобы все работало в соответствии с учебными пособиями, но это не сработало. После установки ‘python’ все еще работал Python 2.6 и PATH не обновлялся.

Это устанавливает pip, используя систему установки пакетов Python по умолчанию, и избавляет вас от хлопот ручной настройки одновременно.

Это позволит вам затем запустить команду pip для установки пакета python, так как он будет установлен вместе с системным python. Я также рекомендую, если у вас есть pip, используя virtualenv package и pattern. 🙂

Используйте setuptools для установки pip :

(Я знаю, что приведенная выше часть моего ответа избыточна с klobucar, но я пока не могу добавлять комментарии), поэтому вот ответ с решением Sudo: easy_install: command not found в Debian/Ubuntu:

pip3 должен быть установлен автоматически вместе с Python3.x. Документация не обновлялась, поэтому просто замените pip на pip3 в инструкциях, например, при установке Flask.

Теперь, если это не сработает, вам, возможно, придется установить pip отдельно.

Следуя инструкциям по загрузке AWS Cli, я изменил

который запустил правильную версию.

Я сделал псевдоним на своей машине, чтобы запустить python3 при наборе python, который обычно запускает версию системы 2.7. Я не уверен, что это хорошая идея сейчас. Я думаю, что я просто наберу команды, как они предполагали

pip установится в корзину вашего установочного места на python. Он также должен создать символическую ссылку на более распространенное место, такое как /usr/local/bin/pip

Вы можете либо отредактировать свой

Установите последнюю версию Python, как указано здесь

Он имеет много ссылок для скачивания, как NumPy и Scipy

Для пакетов установки Python проверьте это

Требования для установки пакетов В этом разделе описываются шаги, которые необходимо выполнить перед установкой других пакетов Python.

Установите pip, setuptools и wheel Если у вас Python 2> = 2.7.9 или Python 3> = 3.4 установлен с python.org, у вас уже будет pip и setuptools, но потребуется обновить до последней версии:

Безопасно загрузите get-pip.py 1

$ Sudo apt-get install python-pip python-dev build-essential

Источник

Bash: pip: команда не найдена

Это в Mac OS X, в котором я тоже новичок, поэтому я предполагаю, что какой-то параметр пути был установлен неправильно, когда я запустил setup.py. Как я могу продолжить исследование? Что мне нужно проверить, чтобы лучше понять точную причину проблемы?

EDIT: Я также попытался установить Python 2.7 для Mac в надежде, что дружественный процесс установки будет заниматься любой домашней работой, как редактирование PATH, и что еще нужно, чтобы все работало в соответствии с учебниками, но это не сработало. После установки запущен «python», все еще запущен Python 2.6, а PATH не обновлялся.

ОТВЕТЫ

Ответ 1

Это устанавливает протокол, используя стандартную систему установки пакета python и одновременно сохраняет все ручные настройки вручную.

Это позволит вам запустить команду pip для установки пакета python, поскольку она будет установлена ​​вместе с системным python. Я также рекомендую, если у вас есть пипс, используя virtualenv пакет и шаблон.:)

Ответ 2

Используйте setuptools для установки pip :

(Я знаю, что вышеприведенная часть моего ответа избыточна с klobucar, но я не могу добавлять комментарии еще), так что вот ответ с решением для sudo: easy_install: command not found на Debian/Ubuntu:

Ответ 3

Прежде всего: попробуйте pip3 вместо pip. Пример:

pip3 должен быть установлен автоматически вместе с Python3.x. Документация не была обновлена, поэтому просто установите pip на pip3 в инструкции, например, при установке Flask.

Теперь, если это не сработает, вам, возможно, придется установить pip отдельно.

Ответ 4

Установите последнюю версию Python, как указано здесь

В нем много ссылок на скачивание, например numpy и scipy

Для пакетов установки Python проверьте это

Требования к установке пакетов В этом разделе описаны действия, которые необходимо выполнить перед установкой других пакетов Python.

Установить pip, setuptools и wheel Если у вас есть Python 2 >= 2.7.9 или Python 3 >= 3.4, установленный с python.org, у вас уже будет пип и setuptools, но нужно будет обновить до последней версии:

В противном случае:

Безопасно Загрузить get-pip.py 1

Запустите python get-pip.py. 2 Это установит или обновит пип. Кроме того, он установит setuptools и колесо, если они не будут уже установлен.

Ответ 5

Оригинальный ответ

pip установится в корзину вашего установочного места на python. Также следует создать символическую ссылку на более распространенное место, например, /usr/local/bin/pip

Вы можете либо отредактировать свой

Ответ 6

В то время как следуя инструкциям по загрузке AWS cli, я изменил

который выполнил правильную версию.

Я сделал псевдоним на своей машине, чтобы запустить python3, набирая python, который обычно запускает системную версию 2.7. Я не уверен, что сейчас это хорошая идея. Я думаю, что я просто наберу команды, поскольку они предполагали, что они будут

Ответ 7

$ sudo apt-get install python-pip python-dev build-essential

Тогда pip будет установлен без проблем, и вы сможете использовать «sudo pip. «.

Ответ 8

Большинство методов установки PIP устарели. Вот последнее (2019) решение. Пожалуйста, скачайте скрипт get-pip

Ответ 9

Добавьте эту строку в

В окне терминала запустите

Ответ 10

Это может быть разрешение root. Я попробовал вход в корневой каталог root, используя

который работает для меня

Ответ 11

установите Homebrew, откройте терминал или ваш любимый эмулятор терминала OSX и запустите

вставьте каталог Homebrew в верхней части переменной среды PATH. Вы можете сделать это, добавив следующую строку внизу вашего файла

Теперь мы можем установить Python 2.7:

Ответ 12

Если вы используете Python 3.5, запустите следующую команду терминала:

Любые другие команды pip в терминале будут похожи:

Ответ 13

Ответ 14

Пользователи CentOS 7 могут просто использовать:

Также рекомендуем использовать virtualenv если вы используете pip. Его можно добавить так же:

Ответ 15

Выйдите из оболочки, затем откройте новую оболочку. Команда pip теперь работает.

То, что решило проблему в этом месте.

Возможно, вам также захочется узнать: команды pip для установки программного обеспечения затем должны были быть написаны, как в этом примере (например, jupyter) для правильной работы в моей системе:

Было бы здорово, если бы pip docs ничего не сказал обо всем этом, но это потребовало бы ввода большего количества символов, я думаю.

Ответ 16

Не уверен, почему это не было упомянуто ранее, но единственное, что сработало для меня (на моем NVIDIA Xavier), было:

sudo apt-get install python3-pip

(или sudo apt-get install python-pip для python 2)

Ответ 17

По состоянию на 2019 год,

Запустите get-pip.py, используя следующую команду:
sudo python get-pip.py

Удалите файл get-pip.py после установки pip.
rm get-pip.py

Ознакомьтесь с инструкциями по установке статьи для получения дополнительной информации.

046dc727a8d4132075baef673eccc385

Ответ 18

Решено это путем обновления Python 3 brew python upgrade : Теперь я могу просто сделать:

Ответ 19

python-pip использует устаревшую версию pip (9.0), текущая версия pip после (18.0) после обновления pip edit /usr/bin/pip заменит этот импорт:

Эта проблема работает для pip 18.0: повторение имени main функции pip change для /usr/bin/pip3 и /usr/bin/pip2

также посмотреть /usr/local/lib/[your_python_version]/dist-packages/pip/__main__.py Он должен быть таким же, как /usr/bin/pip

Ответ 20

Это наверняка установит pip со всеми его зависимостями. PS это для python 3, если вы хотите для python 2 заменить python3 со второй команды на python

Ответ 21

Python устанавливает его по умолчанию, но если он не установлен, вы можете установить его вручную, используя следующий cmd (только для linux)

надеюсь, это поможет.

Ответ 22

Оказалось, что на моей виртуальной машине еще не установлен pip. Вполне возможно, что другие люди могут иметь этот сценарий тоже.

Источник

python 2.7: не удается pip в windows » bash: pip: команда не найдена»

я пытаюсь установить стек SciPy, расположенный по адресу https://scipy.org/stackspec.html [мне разрешено только 2 ссылки; пытаясь использовать их мудро]. Я понимаю, что есть гораздо более простые способы сделать это, но я думаю, что есть много, чтобы узнать, делая это вручную. Я относительно новичок во многих вещах, поэтому прошу прощения, если в какой-то момент я кажусь невежественным.

установлен python-2.7.8.msi (32-bit) от https://www.python.org/download/releases/2.7.8/

установлен matplotlib : matplotlib-1.3.1.win32-py2.7.exe от (ССЫЛКА MATPLOTLIB DOT ORG УДАЛЕНА)

путь, на котором я сохраненный pip_install.py вопрос?

6. ЗДЕСЬ Я НЕ

попытка установить зависимость matlibplot dateutil: открыт Cygwin Shell и набрал

это приводит к ошибке:

любая помощь приветствуется; ближайший, который я нашел, был bash: pip: команда не найдена. Но природа OSX этого вполне достаточно, чтобы confise меня дальше.

UPADTE:

вы можете видеть, что нет выхода или обратной связи от оболочки (которая, я думаю, должна быть). Затем, когда я перехожу к новой оболочке python:

7 ответов

поэтому вам нужно добавить это в свой системный путь, чтобы запустить его из командной строки. Можно как вариант cd в этот каталог каждый раз, но это морока.

см. верхний ответ здесь для получения информации о том, как это сделать: добавление пути Python в Windows 7

пока pip живет в папке скриптов, которую вы можете запустить

это скажет python, чтобы получить pip из папки скриптов. Это также хороший способ иметь оба python2.7 и pyhton3.5 на вашем компьютере и у них в разных местах. В настоящее время у меня есть python2 и pyhton3, установленные в windows. Когда я набираю python по умолчанию на python2. Но если я наберу python3 Я могу использовать python3. (Мне также пришлось изменить python.exe-файл для python3 в «питон3.exe») если мне нужно установить колбу для python 2, я могу запустить

и он будет установлен в папке pyhton2, но если мне нужна колба для python 3, я запускаю:

и теперь у меня есть это в папке python3

в windows 7 Вы должны использовать эту команду: python-m pip install xxx. Все вышеперечисленное не работает на меня.

Если это для Cygwin, он устанавливает » pip «как»pip2″. Просто создайте программную ссылку на » pip2 «в том же месте, где установлен» pip2″.

У меня была аналогичная проблема с запуском SciPy на моем компьютере. Есть два способа решить эту проблему: 1. Да, вам нужно компакт-диск в каталог python. 2. Иногда вам нужно явно указать компьютеру, какой путь нужно пройти, найти используемую программу, открыть свойства и перенаправить путь, необходимый для запуска. 3. обратитесь к руководству: http://matplotlib.org/users/installing.html или http://www.scipy.org/install.html

пакет Scipy очень привередлив, и нуждается в вещах, прописанных в неприятных деталях.

Источник

pip allows you to download packages you can reference in your Python code. If you try to install a package using pip without having the package manager installed on your computer, you’ll encounter the pip: command not found error.

In this guide, we discuss the cause of this error. We then walk through two potential solutions to this error so you can fix the problem you are encountering.

Get offers and scholarships from top coding schools illustration

Find Your Bootcamp Match

  • Career Karma matches you with top tech bootcamps
  • Access exclusive scholarships and prep courses

Select your interest

First name

Last name

Email

Phone number

By continuing you agree to our Terms of Service and Privacy Policy, and you consent to receive offers and opportunities from Career Karma by telephone, text message, and email.

pip: command not found

On Linux, the pip package manager is an independent package. This means you must install pip separately from Python. On Mac, you do not need to worry about installing pip manually, as long as you are working with Python 3.x.

A command not found error is raised on Linux if there is no command on the system by the name you have referenced. You must have pip installed on your system before you can install packages.

Python 2 has reached its end of life. This means Python 2 is no longer being actively maintained or changed. You should try to move your code over to a codebase that supports Python 3. When you are working with Python 3, use pip3 instead of pip.

Cause #1: Using the Wrong Environment

Python 2.7 and other versions of Python 2 rely on the bash pip command whereas the Python 3 command relies on pip3. We have written a program called hello.py which uses a print() statement to display “Hello world!” to the command line console:

This program was written in Python 3. To execute this program, we will use the python3 command:

Our code prints out the message “Hello world!” to the console.

Let’s say that we want to install the “requests” library so we can make a web request in our script. Because we are using Python 3, we should use pip3. If we try to use pip, we’ll encounter an error:

We do not have pip installed because we are working in a Python 3 development environment. If we replace pip with pip3, our command will work:

Our command shows us the installation process:

Requirement already satisfied: requests in ./Library/Python/3.8/lib/python/site-packages (2.24.0)
… 

We already had the requests library installed. If we did not have the requests library installed, we would see pip3 install the library.

The pip3 command uses the pip3 Python package manager to install the “requests” library. We have configured pip3 which means this command works.

If you do not already have pip3 installed, you can install it using apt-get:

sudo apt-get -y install python3-pip

After you have run this command, you’ll be able to use the pip3 package manager on your system.

pip3 is bundled with Python 3 on MacOS so you do not need to run any additional commands. If you do not have pip3 installed already, you should try to reinstall Python 3. This will install pip3 automatically. You can install Python 3 using the brew command:

We now have both Python 3 and pip3 installed on our system.

Cause #2: Not Downloading Python 2 pip

The pip: command not found error may occur if you have not installed Python 2 pip on your system. The below steps should be followed only if your code is written in Python 2. Otherwise, you should move your codebase over to Python 3 because Python 2 has reached its end of life.

To install pip in Python 2, you must use the easy_install command:

This command installs the pip command onto your system. If you do not already have easy_install installed, install it using the following Linux command:

sudo apt-get install python-setuptools

The easy_install tool is deprecated. This is because Python is moving its focus to Python 3 where pip3 is the main package manager that you should use for installing a package.

Conclusion

The pip: command not found error is raised if you do not have pip installed on your system, or if you’ve accidentally used the pip command instead of pip3.

To solve this error, make sure you have installed both Python 3 and pip3 onto your system. If you are working with a legacy codebase, use easy_install to install pip.

Now you have the skills you need to solve this error like a pro!

pip command not found error occurs if pip package is not available in the system or path configuration is not correct. The best solution to fix this error is to reinstall this pip again. This will automatically set the path for the pip package manager. In this article, we will explore every angle for this error. So let’s start-

pip command not found : (Solution) –

Actually, windows users need not install the pip package manager separately. If they install python-pip package manager will automatically come in the distribution.

Window User ( pip package manager) –

All you need to visit python official website and download the latest version/ compatible python version.

pip command not found windows

pip command for windows

pip command not found for Linux User ( pip package manager) –

As I mentioned, pip comes with windows distribution but that is not the case with Linux OS. In Linux, we need to install the pip separately. Here is the command for the same-

sudo apt-get -y install python3-pip

Once we run the above command it will install the pip3 package manager with it.

pip command not found for Mac OS ( pip package manager) –

Similar to windows,  Mac OS Python distribution also contains pip package manager distribution. The easier way to install python is the brew package manager.

brew install python3

How to check pip version?

Here is the command for checking pip version-

pip --version

It will show the current pip version. As the below screenshot signifies the same.

pip version

pip version

Similar error in Windows –

“pip command not found” and “‘pip’ is not recognized as an internal or external command, operable program or batch file” is a similar errors. So the solution will be the same for both the errors. The first one comes in the Linux platform and the other one is for the Windows Platform.

Hope you must find this article informative on pip installation and related errors. Please provide your feedback via comment.

Alternative to pip package manager –

If you do not want to proceed with pip then you can install Anaconda distribution. It offers the conda package manager which is completely identical to the pip package manager. There are differences in pip and conda but it will not affect the core motive behind them.

Thanks
Data Science Learner Team

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

We respect your privacy and take protecting it seriously

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.

I can’t use pip3 though python3-pip has already been installed. How to solve the problem?

sudo pip3 install virtualenv
sudo: pip3: command not found

sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

asked Jun 23, 2015 at 2:56

Searene's user avatar

4

You can use python3 -m pip as a synonym for pip3. That has saved me a couple of times.

phoenix's user avatar

phoenix

7,3385 gold badges37 silver badges44 bronze badges

answered Jun 6, 2016 at 13:45

user2394284's user avatar

user2394284user2394284

5,2064 gold badges31 silver badges34 bronze badges

3

I had a similar issue. In my case, I had to uninstall and then reinstall pip3:

sudo apt-get remove python3-pip
sudo apt-get install python3-pip

Tshilidzi Mudau's user avatar

answered Oct 27, 2015 at 0:32

Kumar's user avatar

KumarKumar

9971 gold badge9 silver badges15 bronze badges

2

Run

locate pip3

it should give you a list of results like this

/<path>/pip3
/<path>/pip3.x

go to /usr/local/bin to make a symbolic link to where your pip3 is located

ln -s /<path>/pip3.x /usr/local/bin/pip3

answered Jun 23, 2015 at 3:04

Mox's user avatar

MoxMox

2,2552 gold badges26 silver badges39 bronze badges

7

Same issue on Fedora 23. I had to reinstall python3-pip to generate the proper pip3 folders in /usr/bin/.

sudo dnf reinstall python3-pip

answered Apr 30, 2016 at 17:01

roflmyeggo's user avatar

roflmyeggoroflmyeggo

1,68416 silver badges18 bronze badges

You can make symbolic link to you pip3:

sudo ln -s $(which pip3) /usr/bin/pip3

It helps me in RHEL 7.6

answered Mar 20, 2019 at 20:53

Mikhail Katulin's user avatar

For Kali, you must use this code after the update.

$sudo python3 get-pip.py

or if you write this, it also works but not supported anymore. So don’t use:

$sudo python get-pip.py

answered May 28, 2020 at 15:22

mutluergoz's user avatar

Probably pip3 is installed in /usr/local/bin/ which is not in the PATH of the sudo (root) user.
Use this instead

sudo /usr/local/bin/pip3 install virtualenv

answered Oct 15, 2019 at 10:52

nightlytrails's user avatar

nightlytrailsnightlytrails

2,3143 gold badges20 silver badges32 bronze badges

On Windows 10 install Python from Python.org
Once installed add these two paths to PATH env variable
C:Users<your user>AppDataLocalProgramsPythonPython38
C:Users<your user>AppDataLocalProgramsPythonPython38Scripts

Open command prompt and following command should be working
python —version
pip —version

answered Jul 22, 2020 at 4:34

Amandeep's user avatar

AmandeepAmandeep

1391 silver badge5 bronze badges

This is the generic solution for all type of issues like Package 'xyz' has no installation candidate or command not found but is already installed:

just run this command

rmadison <package_name>

eg: rmadison python3-pip

The above command will query the apt database.

if you were not able to run the above command: sudo apt install devscripts and then run rmadison command.

and to query for specific distro use | grep focal
-> rmadison <package_name> | grep focal

answered Oct 10, 2022 at 7:04

Deepanshu Mehta's user avatar

There is no need to install virtualenv. Just create a workfolder and open your editor in it. Assuming you are using vscode,

$mkdir Directory && cd Directory
$code .

It is the best way to avoid breaking Ubuntu/linux dependencies by messing around with environments. In case anything goes wrong, you can always delete that folder and begin afresh. Otherwise, messing up with the ubuntu/linux python environments could mess up system apps/OS (including the terminal). Then you can press shift+P and type python:select interpreter. Choose any version above 3. After that you can do

$pip3 -v

It will display the pip version. You can then use it for installations as

$pip3 install Library

answered Oct 10, 2018 at 16:00

Neville Lusimba's user avatar

Neville LusimbaNeville Lusimba

8071 gold badge8 silver badges10 bronze badges

I can’t use pip3 though python3-pip has already been installed. How to solve the problem?

sudo pip3 install virtualenv
sudo: pip3: command not found

sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

asked Jun 23, 2015 at 2:56

Searene's user avatar

4

You can use python3 -m pip as a synonym for pip3. That has saved me a couple of times.

phoenix's user avatar

phoenix

7,3385 gold badges37 silver badges44 bronze badges

answered Jun 6, 2016 at 13:45

user2394284's user avatar

user2394284user2394284

5,2064 gold badges31 silver badges34 bronze badges

3

I had a similar issue. In my case, I had to uninstall and then reinstall pip3:

sudo apt-get remove python3-pip
sudo apt-get install python3-pip

Tshilidzi Mudau's user avatar

answered Oct 27, 2015 at 0:32

Kumar's user avatar

KumarKumar

9971 gold badge9 silver badges15 bronze badges

2

Run

locate pip3

it should give you a list of results like this

/<path>/pip3
/<path>/pip3.x

go to /usr/local/bin to make a symbolic link to where your pip3 is located

ln -s /<path>/pip3.x /usr/local/bin/pip3

answered Jun 23, 2015 at 3:04

Mox's user avatar

MoxMox

2,2552 gold badges26 silver badges39 bronze badges

7

Same issue on Fedora 23. I had to reinstall python3-pip to generate the proper pip3 folders in /usr/bin/.

sudo dnf reinstall python3-pip

answered Apr 30, 2016 at 17:01

roflmyeggo's user avatar

roflmyeggoroflmyeggo

1,68416 silver badges18 bronze badges

You can make symbolic link to you pip3:

sudo ln -s $(which pip3) /usr/bin/pip3

It helps me in RHEL 7.6

answered Mar 20, 2019 at 20:53

Mikhail Katulin's user avatar

For Kali, you must use this code after the update.

$sudo python3 get-pip.py

or if you write this, it also works but not supported anymore. So don’t use:

$sudo python get-pip.py

answered May 28, 2020 at 15:22

mutluergoz's user avatar

Probably pip3 is installed in /usr/local/bin/ which is not in the PATH of the sudo (root) user.
Use this instead

sudo /usr/local/bin/pip3 install virtualenv

answered Oct 15, 2019 at 10:52

nightlytrails's user avatar

nightlytrailsnightlytrails

2,3143 gold badges20 silver badges32 bronze badges

On Windows 10 install Python from Python.org
Once installed add these two paths to PATH env variable
C:Users<your user>AppDataLocalProgramsPythonPython38
C:Users<your user>AppDataLocalProgramsPythonPython38Scripts

Open command prompt and following command should be working
python —version
pip —version

answered Jul 22, 2020 at 4:34

Amandeep's user avatar

AmandeepAmandeep

1391 silver badge5 bronze badges

This is the generic solution for all type of issues like Package 'xyz' has no installation candidate or command not found but is already installed:

just run this command

rmadison <package_name>

eg: rmadison python3-pip

The above command will query the apt database.

if you were not able to run the above command: sudo apt install devscripts and then run rmadison command.

and to query for specific distro use | grep focal
-> rmadison <package_name> | grep focal

answered Oct 10, 2022 at 7:04

Deepanshu Mehta's user avatar

There is no need to install virtualenv. Just create a workfolder and open your editor in it. Assuming you are using vscode,

$mkdir Directory && cd Directory
$code .

It is the best way to avoid breaking Ubuntu/linux dependencies by messing around with environments. In case anything goes wrong, you can always delete that folder and begin afresh. Otherwise, messing up with the ubuntu/linux python environments could mess up system apps/OS (including the terminal). Then you can press shift+P and type python:select interpreter. Choose any version above 3. After that you can do

$pip3 -v

It will display the pip version. You can then use it for installations as

$pip3 install Library

answered Oct 10, 2018 at 16:00

Neville Lusimba's user avatar

Neville LusimbaNeville Lusimba

8071 gold badge8 silver badges10 bronze badges

Like this post? Please share to your friends:
  • Bash php command not found windows
  • Bash on ubuntu on windows install
  • Bash npm command not found windows
  • Bash make command not found windows
  • Bash java command not found windows