Setting the 'correct' pip3 - linux

I have Python 2.7 installed (by default) and also a Python3.x. I installed anaconda later. When I use pip3, it uses the pip3 for Python3.x I guess. When I do which pip3 on terminal, it shows user/bin/pip3. But I want it to use pip3 from anaconda. How do I go about doing that?

Try this in the Anaconda prompt:
conda install pip3
If that doesn't work, in the same prompt try
pip install pip3

Related

no module named "pip" in python

I am on python 3.8.5 I am using python and pip, pipenv recently without any issue on any terminal and project. But, today when I try to do anything with pip or pipenv, I get this error
No Module Named "pip"
I even installed python latest version again and I know that on 3.8.5, I don't have to download pip. I can't even check the pip version in the terminal.
Type in sudo apt-get install python3-pip in the terminal to install pip

how do I upgrade pip on Mac?

I cannot upgrade pip on my Mac from the Terminal.
According to the documentation I have to type the command:
pip install -U pip
I get the error message in the Terminal:
pip: command not found
I have Mac OS 10.14.2, python 3.7.2 and pip 18.1.
I want to upgrade to pip 19.2.3
upgrading pip as of 09/2020:
pip3 install --upgrade pip==20.2.2
pip3 install --upgrade pip
this works for me!
Try this
pip install --upgrade pip==19.2.3
Hope this will help you.
I have found an answer that worked for me:
sudo pip3 install -U pip --ignore-installed pip
This installed pip version 19.2.3 correctly.
It was very hard to find the correct command on the internet...glad I can share it now.
Thanks.
If you want to upgrade to the latest pip version (as of this writing pip-21.2.4) and you are using mac, do the following:
Open your terminal, on your main folder and type:
$ pip3 -V
This will give you the version you have installed
Then type:
$ pip3 install --upgrade pip
Or
$ sudo pip3 install --upgrade pip
The latest if you need to input your password
try:
sudo -H pip3 install --upgrade pip
I came on here to figure out the same thing but none of this things seemed to work. so I went back and looked how they were telling me to upgrade it but I still did not get it. So I just started trying things and next thing you know I seen the downloading lines and it told me that my pip was upgraded. what I used was (pip3 install -- upgrade pip). I hope this can help anyone else in need.
Make sure you have pip installed in the first place. Refer to https://pip.pypa.io/en/stable/installing/ to install pip.
For MAC with M1 :
pip3 install --upgrade pip
If you want to install specific version:
pip3 install --upgrade pip==21.1.1
After pip == version_number should be entered
If you want to know more about pip commands:
pip3 help

How to install xlrd in python3 library

I am trying to install xlrd to read Excel files in python.
I have tried this: pip install -U pip setuptools. My macOS Mojave 10.4.3 has Python 2.7 which is where the default install goes to. But I have also installed Python3.7. How do I get pip install to my 3.7 directory?
I am on Mac machine(Catalina -version 10.15.5) and below pip3 command worked for me.
pip3 install xlrd
python version : 3.7.6
OS : Mac-Catalina(10.15.5)
Thanks to #Tapan Hegde, pip3 install xlrd worked from me, after installing the pip3, like this:
sudo apt update
apt install python3-pip
pip3 install xlrd
I reckon the easiest/cleanest solution would be to use a tool that isolates your python environment, such as virtualenv
Once installed, create a virtual env by specifying which version of python you want to use:
$> virtualenv -p python3 env
Note: puttin python3 directly works only for mac, with linux, you must specify the absolute path or your python binary.
And then 'activate' your environment:
$> source env/bin/activate
From here, any python or pip command you use will use python3.
$> pip install xlrd
Virtualenv has the advantage of not 'polluting' your local python installation, your can manage your pip modules installed more easily.
If you want more detail on how it works and the other alternatives, check this post
When pip install xlrd not work and in computer is still old version, then try do it with current version, for example pip install xlrd==2.0.1.
The current versions are here

Python3.6 is installed but pip3 command not found on Mac os x

I have installed python3.6 and Jupiter Notebooks on my computer using anaconda. Now, I need to install TensorFlow for python3. To show the version of pip: I type these command:
pip -V: pip 9.0.1 from /Users/xxx/anaconda3/lib/python3.6/site-packages (python 3.6).
pip3 -V: command not found.
What I understand is pip pointed to python3.6 and I can use it to install Tensorfolw (it is like a alias to pip3). Is it correct?

Use or install different versions of python3 pip

I'm trying to install packages for my python 3.5.0 versus my python 3.4.3
I can run both by typing either python3.4 or python3.5
I have pip2 and pip3. I also ran the script sudo easy_install3 pip, which made me be able to use pip3.4 But I am still having trouble installing modules for python3.5. pip3 just installs for python3.4
I am looking to install termcolor for python3.5 and I am having no success. Can anyone help?
I am on Windows, and you appear not to be, but maybe the following will help.
If pip is in your system's equivalent of python35/Lib/site-packages, then python3.5 -m pip should run pip so that it installs into the 3.5 site-packages.
If you do not have pip in the 3.5 site-packages, copy its directory, along with its dependencies (pip....dist-info/, setuptools/, setuptools....dist-info/, and easyinstall.py) from the 3.4 site_packages.
Or, if pip3 or even pip3.4 is in python35/Scripts, run it with its full path name so you are not running the 3.4 version.

Resources