"Uninstalling pip-19.0.1:" hangs - pip

I tried to do pip install --upgrade pip in my Mac, but it hanged at Uninstalling pip-19.0.1:.
Could anyone tell me what I should do?
Ties-MBP:10studio-4 chengtie$ pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pip
Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 1.1MB/s
Installing collected packages: pip
Found existing installation: pip 19.0.1
Uninstalling pip-19.0.1:

You should do it with an administrator account. Try "sudo pip install --upgrade pip".

Related

Why I can't pip install nltk on mac os?

I'm using mac os mojave, install python 2.7 and install pip using python get-pip.py, I already try those command to install pip :
pip install --upgrade pip
pip install nltk
and try
sudo python -m pip install --upgrade nltk
But also result to same error like in this image
Or here in text:
error in nltk setup command: 'install_requires' must be a string or
list of strings containing valid project/version requirement
specifiers; Expected version spec in singledispatch; python_version <
"3.4" at ; python_version < "3.4"
Is it because my python version (2.7) ? But in pip ntlk page it says also support 2.7
update:
pip install nltk success after running :
pip install --upgrade setuptools pip --user
Start with upgrading installation tools:
pip install --upgrade setuptools pip

Tensorflow installation on Windows 10, error 'Not a supported wheel on this platform'

This question is for a Windows 10 laptop. I'm currently trying to install tensorflow, however, when I run:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
I get the following error:
tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform.
I am trying to install the cpu-version only of tensorflow in an Anaconda 4.3.0 version. I had python 3.6.0 and then I downgraded to 3.5.0, none of them worked.
I also had same problem when I installed anaconda 4.3 version
Here is my solution.
Instead of using Anaconda3 4.3, install Anaconda3 4.2(Anaconda3-4.2.0-Windows-x86_64.exe)
Type on command line(If you are using GPU version)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
Typeon command line(If you are using CPU only)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl
I'm working on win10 with python version=3.5.2, 64 bit
You can use same version of anaconda and execute this command
conda create -n tensorflow python=3.5
activate tensorflow
pip install tensorflow-gpu
It worked for conda 4.0.8
So are you sure you correctly downgraded your python? Run this command on command line pip -V. This should print the pip version and the python version.
Inside your Anaconda environment, try running this:
pip install --upgrade tensorflow
This will do the job. The issue was discussed here also.
Here is the screenshot of how this helped me:
If you have python3 on Windows insatalled, you can use the following command(non GPU):
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl
Worked for me.

pip not updating to newest version

When I run pip install -U pip it doesn't install the newer version.
drahcir#Altair:~/dev$ pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
drahcir#Altair:~/dev$ pip install -U pip
Downloading/unpacking pip
Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Successfully installed pip
Cleaning up...
drahcir#Altair:~/dev$ pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
Even though it says it downloaded pip 8.1.2, the pip version still says 1.5.6
How can I get pip to upgrade to 8.1.2?

Cannot install pip for python3 on mac

When I run
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3 get-pip.py
It gives me this error:
Downloading/unpacking pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /var/root/.pip/pip.log
However if I just run:
sudo python get-pip.py
There is no problem:
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.2-py2.py3-none-any.whl#md5=445a893564065937c0f31ac2cc8e2f35
Downloading pip-1.5.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Found existing installation: pip 1.5.1
Uninstalling pip:
Successfully uninstalled pip
Successfully installed pip
Cleaning up...
Can anyone help please? Thanks!
This is a simple permissions issue. If you're installing to the system Python installation, you should need root, which is what sudo provides.
If you need to install stuff where you don't have root privileges, you need to look into Python virtual environments.

latest version of psycopg2 on aws

I am trying to get the latest version of psycopg2 on my aws instance. I noticed that the latest version was 2.4.6 but I could only get 2.0.14 on aws. Is there a way to get the latest version? There are some features I need that are not supported in the earlier versions.
This works for me in Amazon aws-cli/1.9.11 Python/2.7.10 Linux/4.1.10 and Ubuntu 14
If pip not installed in your Amazon AWS machine type:
$ sudo yum install python-pip
and then type below commands:
$ sudo yum update
$ sudo yum install libpq-dev python-dev
$ sudo pip install psycopg2
Then you will get message like below :
You are using pip version 6.1.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting psycopg2
Downloading psycopg2-2.6.1.tar.gz (371kB)
100% |████████████████████████████████| 372kB 1.3MB/s
Installing collected packages: psycopg2
Running setup.py install for psycopg2
Successfully installed psycopg2-2.6.1
If pip not installed in your Ubuntu machine type:
$ sudo apt-get install python-pip
and then type below commands:
$ sudo apt-get update
$ sudo apt-get install libpq-dev python-dev
$ sudo pip install psycopg2
Then you will get message like below :
You are using pip version 6.1.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting psycopg2
Downloading psycopg2-2.6.1.tar.gz (371kB)
100% |████████████████████████████████| 372kB 1.3MB/s
Installing collected packages: psycopg2
Running setup.py install for psycopg2
Successfully installed psycopg2-2.6.1
If you need a more recent version of psycopg2 on your EC2 instance, you can install it directly with pip using: $ pip install psycopg2
You may need to first install the python-dev and libpq-dev libraries as explained in this StackOverflow question.
Working answer as of November 2022:
sudo yum install postgresql-devel python3-devel
pip install wheel
pip install psycopg2
If you are still using Python 2 then use python-devel instead of python3-devel.
The pip install wheel is not strictly necessary, but psycopg2 prefers it and it wasn't installed yet in my environment.

Resources