Upgrading pip on mac - python

I'm trying to upgrade pip on my mac using this command
pip install --upgrade pip
After I enter that command I get this error
zsh: command not found: pip
I also can't even seem to get the version of pip when I enter this
pip --version
I get the same error.
I am new to this and I'm not sure what I'm doing wrong. It is possible the fact that I'm using zsh but honestly, I'm pretty sure I changed to zsh when installed homebrew but I forget what zsh even means for me.

Solution:
I solved my issue by using pip3 install --upgrade pip to upgrade to the latest version of pip. Now install using pip install works fine.
I'm not sure why I had to use pip3 but it works now.

Related

Install opencv-python module

I'm trying to install the opencv module without success, I think the problem is related to the version of python I'm using.
Indeed I upgraded to the 3.9.1 version but when I'm trying to install the module, I still receive a warning referred to the old version of python I had (i.e. 2.7).
How can I get rid of this situation and successfully install the opencv library?
Error in bash
The issue is because the pip you are using in the insallation command conforms to pip2 which is used for installing packages for python2 (as is evident from the command output). You can verify the version by running:
pip --version
To solve the issue, use pip3:
sudo -H pip3 install opencv-python
If pip3 is not installed, install it via HomeBrew:
brew install python3
It should install pip3 as well. Also, have a look at this.

How to solve the "pip install pygame" issue?

I am trying to use command pip install pygame in cmd, but there is error.
The error is shown as follows:
C:\Users\Administrator>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/80/2c/3a52e7e9c097229b026b4efbe6711c600f3a84ffdc5f11fd9e7f8932368e/pygame-1.9.6-cp37-cp37m-win32.whl
Installing collected packages: pygame
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'c:\\program files (x86)\\python37-32\\Lib\\site-packages\\pygame'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I follow the instruction in the error but still cannot solve the problem. And I also found whatever "pip" command cannot be installed correctly.
You can install the package as Administrator, by following these steps:
1.Right click on the Command Prompt icon
2.Select the option: Run This Program As An Administrator
3.Run the command: pip install pygames
Instead of you can use the command
pip install --user pygames
The other answers didn't work for me. I checked this site and made sure that pip, setuptools, and ez_setup were installed at the latest versions. Still no luck. Finally, I discovered the magic words here:
pip install pygame --pre
Per this, --pre option tells pip to include pre-release versions of packages when searching for the latest version. Apparently that's what's needed as of this writing (2023-02-08).
(Thanks to accddd)
check if Pip was installed correctly by opening a command prompt and entering the following command:
pip -V
output should be like:
pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
if pip is not install copy this file link and save it to setup.py
now open cmd and run script by typing
python setup.py
for more details check link.
when pip in install correctly install run this commond
python -m pip install -u pygame --user
For this, you have to install pygame package from the cmd (on Windows) or from the terminal (on mac). Just type pip install pygame.If it doesn't work for you, then try using this statement pip3 install pygame. If it is still showing an error then you don't have pip installed on your device and try installing pip first.

Upgrade pip to ver18 on anaconda

I am using anaconda 64-bit for python v3.6 on Windows 10.
Whenever I use pip on anaconda, I get the following message;
You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I read that the safe way to upgrade pip on anaconda is to use conda;
conda update pip
However, using the conda command does not upgrade to ver18. Is it safe to use python -m pip install --upgrade pip to force pip to be upgraded to ver18? Any risk of breaking anaconda? Anyone tried?
I will answer my own question. I got the answer thanks to one of the comments from abarnert who suggested conda-forge.
Run the commands below;
conda config --add channels conda-forge
conda update pip
A bit different here but I'm using Linux.
Even though I had conda-forge in my channel list, I still couldn't just run conda update pip to update. I had to run the following to install that specific version.
conda install pip=18.0
Enter the following command:
python.exe -m pip install --upgrade pip
Small update:
Anaconda has recently distributed pip 18.1 version.
Both via Anaconda Prompt or via Anaconda Navigator, you should be able to upgrade pip and its dependencies (libcur, pycurl, qt, so on and so forth).
Simple pip upgrade command worked for me
pip install --upgrade pip
Let me know if that doesn't work for you.

Trouble with installing pip 8.1.1 from 7.1.2

I'm having an issue with upgrading pip from 7.1.2 to 8.1.1. At first I downloaded Python 3.4 and installed pip from there but then noticed Python 3.5 was there so I downloaded that. When trying to use pip to install selenium it says You are using pip version 7.1.2 however 8.1.1 is available. I do "pip install --upgrade pip" then get an error. See attached screenshot.What do I do? Btw I'm on windows 8.1.enter image description here
Ok. It's working if I run cmd as an admin then do
python -m pip install --upgrade pip
In Mac, I ran:
sudo python -m pip install --upgrade pip
Then, it worked.
Did you try python -m pip install --upgrade pip? if pip is being used, it cannot install itself.
This is a common question that requires few germane steps to pre-installing other modules in Python.
Depending on the version of your Python (Either the 2.X series or the 3.X series), and the operation system (Window, Ubuntu, etc ), you will need to do the following;
Open CMD (Short-Cut: Control+R button on the keyboard)
Make sure the current directory is the administrator on the hard-drive of the system and your internet connection is available.
i.e C:\Users\System_Name PC
Type in the command:
Pip install --upgrade pip
i.e C:\Users\System_Name PC > pip install --upgrade pip
and hit ENTER key to activate:
It will uninstall the previous version and install the latest version
Restart the system and continue the installation of each python module
e.g Pip install dateutil
Pip install numpy
Pip install matplotlib
Peradventure you wish to specify the version of the python module dependencies you want to install;
Pip install Django==1.90
It will install the specific version: otherwise if not specified, the latest version of the target module would be installed.

How to fully uninstall pip installed with easy_install?

On Windows 7, I install pip with easy_install and want to install a lower version of pip.
I want to remove the old version, but have no idea how to completely remove the pip installed by easy_install (or if there is a way to do it without going through easy_install, that is fine). How do I do this?
There is no completely automatic uninstall but you can do it in two steps:
easy_install -m pip
This should remove pip from easy-install.pth and print the full path to where pip is installed. Now just manually remove the path that the previous command printed. Or you could just manually edit easy-install.pth and remove the pip sources if you know where they are located.
I found that the following command worked.
It deleted the installed files and the .egg directory.
It also provided a confirmation prompt.
pip uninstall pip
From this answer.
To uninstall pip in windows:
Run command prompt as administrator
Give the command easy_install -m pip
This may not uninstall pip completely. So again give this command pip uninstall pip If by previous command pip got uninstalled then this command wont run, else it will completely remove pip
Now check by giving command pip --version This should give pip is not recognized as an internal or external command

Categories