uninstalling pip3 on mac - python

I am trying to get the installation right with python 3, pip and pip3. I am working on a mac and by default. I have Python 2.7.10
python -V
Python 2.7.10
python3 -V
Python 3.5.1
What is the correct order of installation commands to install python3 pip and pip3 so that both pip and pip3 can be linked to python3?
This what I get when I try to see what versions I already have:
$ pip -V
-bash: /usr/local/bin/pip: No such file or directory
$ pip3 -V
pip 7.1.2 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
I need to get this right so that I can install numpy afterward because now with what I have above this is what I get:
$ pip3 install numpy
Collecting numpy
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

I have Solved it. as #keithpjolley suggested. I installed anaconda, launched it, and I used the command:
conda install numpy
I let it solve the environment. It gave me an older version of numpy at first so I upgraded:
conda install numpy=1.13
Now everything is working with my code.

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

"pip install" installed packages for all version of python on my MacOS

Using macOS Catalina(10.15.5). I installed Python3.8 from python.org along with pip3.
Somehow my pip3 and pip now point to the same pyhton3.8.
pip -V
pip 20.1.1 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
pip3 -V
pip 20.1.1 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
So I thought if I do pip install numpy, or pip3 install numpy, numpy would be installed for python3.8.
However, when I tried to import numpy using python2.7(pre-built into macOS), it showed that numpy is there somehow. But I think I only installed pip for python3.8, so how come python2.7 also gets installed numpy.
python -V
Python 2.7.16
>>> import numpy
>>> print(numpy)
<module 'numpy' from '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc'>

MacOS - Are my pip and pip3 locations correct?

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)

Python 3.5.0 can't install anything through pip version 7.1.2

When I try to install anything with (for example) python3 -m pip install numpy , I get
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
I've tried upgrading pip3 with python3 -m pip install --upgrade pip but have only gotten
Requirement already up-to-date: pip in
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-
packages
and when I do python3 -m pip --version I get
pip 7.1.2 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
I'm unable to install any modules at all. Any advice? I am on MacOS.
To solve your problem, I suggest you use brew as the package manager and install python, not as binary from the python.org but binary using brew (https://brew.sh), I hope it'll fix your troubles, during the installation process.
Install brew package manager:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install "python3" on your machine (python2 can be installed in the same way):
$ brew install python3
Check what version of python you are using:
$ which python3
Output(should look like): /usr/local/bin/python3
Check what pip you are using:
$ which pip3
Output(should look like): /usr/local/bin/pip3
Then you can install any package using "pip":
$ pip3 install virtualenv
Verify that package was installed:
$ pip3 freeze | grep virtualenv
Update pip manually, first download pip:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
and then run the command
python3 get-pip.py
Now you can install with pip3
pip3 install numpy

install numpy on python 3.5 Mac OS High sierra

I wanted to install the numpy package for python 3.5 on my Mac OS High Sierra, but I can't seem to make it work.
I have it on python2.7, but I would also like to install it for the next versions.
Currently, I have installed python 2.7, python 3.5, and python 3.7.
I tried to install numpy using:
brew install numpy --with-python3 (no error)
sudo port install py35-numpy#1.15.4 (no error)
sudo port install py37-numpy#1.15.4 (no error)
pip3.5 install numpy (gives "Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy" )
I can tell that it is not installed because when I type python3 and then import numpy as np gives "ModuleNotFoundError: No module named 'numpy'"
Any ideas on how to make it work?
Thanks in advance.
First, you need to activate the virtual environment for the version of python you wish to run. After you have done that then just run "pip install numpy" or "pip3 install numpy".
If you used Anaconda to install python then, after activating your environment, type conda install numpy.
If running pip3.5 --version or pip3 --version works, what is the output when you run pip3 freeze? If there is no output, it indicates that there are no packages installed for the Python 3 environment and you should be able to install numpy with pip3 install numpy.

Categories

Resources