MacOS - Are my pip and pip3 locations correct? - python

I am new to python (not new to programming) and unfortunately butchered my previous python 3.7 installation while figuring things out. Long story short, I ended up deleting and reinstalling pip3, which in turn made the standard pip command (for the 2.7 pre-installed version of python o macOS) not exist. I've managed to get both installed again but am concerned with their locations.
My question is regarding the locations of both pip and pip3 when running the pip --version as well as the pip3 --version command.
Below is the output for these commands:
pip --version
pip 19.3.1 from /Users/Wyatt/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)
pip3 --version
pip 19.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
I believe pip3 is in the correct location, but feel that the pip command should not be located inside of my user library, but the system library like pip3. Is this correct, and if not, how can I fix this?

On my local machine MacOs the default pip resides at the following location
pip --version
pip 19.3.1 from /Library/Python/2.7/site-packages/pip-19.3.1-py2.7.egg/pip (python 2.7)
And after installing python3 using HomeBrew brew install python3, pip3 location is the following.
pip3 --version
pip 19.3.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

Related

How can I change pip version

I'm using python3.8.6 and I need to upgrade to 3.9.x. After upgrade the python, myproject.py cannot find a module that already installed using pip3 install opencv-python.
when run python3 myproject.py occurs error that ModuleNotFoundError tensorflow, and tensorflow should be 2.5.x so I'm trying to install python 3.9.x.
pip --version shows pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
How can I change that (python3.8) to (python3.9)?
sorry for my bad English..
python -m pip install –upgrade pip.
If you type pip list it will show you every package installed and should say something like WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via this command:
c:\users\x\python.exe -m pip install --upgrade pip

Upgrading pip3 for newer python version

I upgraded python from 3.6.1 to 3.9.2. However, and when I check the pip3 version, it's still using the old python:
$ pip3 --version
pip 21.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
My objective would be to upgrade pip but, more importantly, that pip3 pointed to /usr/local/lib/python3.9/site-packages/pip in order to use the upgraded python.
P.S. Erasing and reinstalling pip3 did not work, it still takes the old python3.

When i run pip3 freeze or pip3 list there is no output

As the title says, when i run pip3 freeze or pip3 list there is no output on the terminal!
Virtualenv seems also to be broken cause when i was inside of the env it was using the global django-admin.
I did sudo pip3 install --upgrade pip and after that i think it broke.
OS: Manjaro Linux
Python3 Version: Python 3.7.4
Pip3 Version: pip
19.2.3 from /usr/lib/python3.7/site-packages/pip (python 3.7)
Find out how to cleanly reinstall pip (or even Python) from your operating system and really try to avoid anything with sudo pip or even sudo python. My recommendation is to not even install pip at all and use the one preinstalled in the virtual environments (when you do python3 -m venv .venv) instead, this is to avoid any conflict with the Python packages installed by your operating system.

pip freeze gives different version from pip --version

I am on Windows 10 and just installed Python 3.7.4. I installed virtualenv using pip install virtualenv, and i got the message that i installed 16.7.2 while 19.2.1 is available. I then used python -m pip install --upgrade pip to upgrade.
Here is the issue: when i type pip freeze on Powershell, i am getting this:
virtualenv==16.7.2
but when i type pip --version, i am getting this:
pip 19.2.1 from c:\users\user1\python\lib\site-packages\pip (python 3.7)
Can you please let me know why pip freeze still shows the old version?
Thanks.
pip and virtualenv are 2 different cases where pip is mainly used for installing python packages and virtualenv for utilizing virtual environments while development.
The following command updates only pip not virtual env
python -m pip install --upgrade pip
If you think you still need to upgrade virtualenv (of course if a new version is available). Please follow the following syntax without specifying a version.
pip install [package] --upgrade

Upgrading pip for different versions of python

I have two versions of python installed on my computer (3.6 and 3.7). Just upgraded pip to the latest version (19.0.1) using the command python -m pip install --upgrade pip however i think it only upgraded the pip for python version 3.6. When attempting to install a package specifically for python version 3.7 with the following command pip3.7 install scipy i got the message saying You are using pip version 18.1, however version 19.0.1 is available. Clearly only the pip for version 3.6 was upgraded. I cannot figure out a command to upgrade 3.7 pip as well. I tried the following:
python -m pip3.7 install --upgrade pip
This did not work (Trying to use the logic of how packages are handled for different versions of python). Could not find a question that addressed this specific issue. Any help would be greatly appreciated.
Use the python 3.7 interpreter to run the command:
python3.7 -m pip install --upgrade pip
Or use the pip3.7 binary directly:
pip3.7 install --upgrade pip
export LD_LIBRARY_PATH=/usr/lib64
activate pip3
I ran into the same problem. If you have Microsoft Visual also installed the best command to use is
py -m pip install --upgrade pip --user
I used that command, and it worked like a charm.

Categories

Resources