Tensorflow: ERROR: Cannot uninstall 'wrapt'. during upgrade

Created on 27 Jun 2019  ·  63Comments  ·  Source: tensorflow/tensorflow

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 19.04 on Sony notebook):
  • TensorFlow version:
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
/home/ronald/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
>>> print(tf.__version__)
2.0.0-alpha0

Describe the problem
I try to upgrade to beta1 with:
install tensorflow==2.0.0-beta1
at the end I get:

Installing collected packages: wrapt, tensorflow
  Found existing installation: wrapt 1.10.11
ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

How to fix it?

Most helpful comment

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

All 63 comments

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

It didn't work for me. Still getting that error.

Edit: Fixed it by installing tensorflow 1.14 first then updating it to version 2.0

it work for me. Thank you

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

It work for me. Thank you

Works for me, thanks!

It didn't work for me. Still getting that error.

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

It worked for me also.

conda update --all
pip install tensorflow

It didn't work for me. Still getting that error.

try
conda update wrapt

conda update --all
pip install tensorflow

this worked for me!!!!

PS: I got a reboot after the first line was done.
I have windows 10.

Above solutions are not worked for me. So I remove the `wrapt' by conda operation.

conda remove wrapt

And, it worked.

pip install tensorflow

Env: Windows 10

it work for me. Thank you

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

It work for me. Thank you

agreed!

None of the solutions worked for me.
I am always getting ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
and with conda remove wrapt I get RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment.

env: Mac OS 10.14.5

Above solutions are not worked for me. So I remove the `wrapt' by conda operation.

conda remove wrapt

And, it worked.

pip install tensorflow

Env: Windows 10

This worked for me.

Tensorflow seems to have trouble being friendly with other packages. The following worked for me, starting from a clean conda environment:

pip install --upgrade pip
pip install six>=1.12.0
pip install httplib2==0.12.0
pip uninstall -y setuptools
pip install setuptools>=41.0.0

pip install tensorflow==1.14.0
pip install tfx

pip install pylint

This sequence gets rid of wrapt as well as tensorboard warnings and google-apitools failures.

This worked for me. I am using Jupyter notebook (OD: Ubuntu 16.0) all the commands running from the notebook:

At the time of installing tensor flow I got following two errors. The errors and solutions are:
ERROR 1: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Solution: run following command
!conda remove wrapt --yes

ERROR 2: tensorboard 1.14.0 has requirement setuptools>=41.0.0
Solution: run following command to solve this error
!pip uninstall -y setuptools
!pip install setuptools>=41.0.0

Now install tensorflow:
!pip install tensorflow

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

It works for me. Thanks.

conda update --all
pip install tensorflow

It works for me. thank you.

It didn't work for me. Still getting that error.

try
conda update wrapt

It didn't work for me. Still getting that error.

try
conda update wrapt

It works for me. Thank you.

It didn't work for me. Still getting that error.

try
conda update wrapt

It worked for me. Thanks a lot.

Above solutions are not worked for me. So I remove the `wrapt' by conda operation.

conda remove wrapt

And, it worked.

pip install tensorflow

Env: Windows 10

Thanks @NoSyu this work me

This worked for me
pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me
pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me too.

pip install wrapt --upgrade --ignore-installed
pip install tensorflow
This worked for me too,Thanks.

Worked like charm

Above solutions are not worked for me. So I remove the `wrapt' by conda operation.

conda remove wrapt

And, it worked.

pip install tensorflow

Env: Windows 10

it works for me, thanks very much!

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

Thanks..It worked for me.

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

works for me too!!!!

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

Worked for me too

It didn't work for me. Still getting that error.

Edit: Fixed it by installing tensorflow 1.14 first then updating it to version 2.0

This is is the only thing that worked for me. Thanks.

Tried removing 'wrapt' and installing tensorflow v2.0 and then numpy threw a similar error.

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

it worked for me as well , thanks.

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

@rickykim93 you are awesome... I love you...

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

Hi, I had this problem in Raspberry Pi and your procedure worked for me.
Thank you.

Above solutions are not worked for me. So I remove the wrapt' by conda operation. conda remove wrapt And, it worked. pip install tensorflow`
Env: Windows 10

This worked for me.

This also worked for me. Env: Mac OS 10.14.6

above problem solution

How to fix it?
if "pip install tensorflow" command won't work...
try to "update conda --upgrade all"
then "conda install tensorflow" this will definitely work.

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

Great fix.

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

Thanks alot,
it works for me and able to installed TensorFlow and keras

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

Works for me, thanks :)

它对我有用。谢谢

我通过以下方式修复它:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

它对我有用。谢谢
me too

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

This works for me, thanks!

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

worked...great..thanks

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This works for my Windows 8.1

However, I was asked to consider upgrade the pip.
And I did it first of all, using:
python -m pip install --upgrade pip

Thanks!

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me too in my mac,Thanks.

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

Thanks so much! This saved me.

I fixed it by:

conda update --all
pip install --upgrade tensorflow==2.0.0-beta1

This worked for me

conda update --all
pip install tensorflow

This worked for me
Env: Mac OS 10.14.6

try conda from anaconda prompt or else it doesnt work

This worked for me on a mac OS 10.14. Running in the terminal.

pip install wrapt --upgrade --ignore-installed pip install tensorflow --upgrade

I also fixed it by simply running

conda update wrapt

I think this avoids other unwanted upgrades by conda

This worked for me:
pip install wrapt --upgrade --ignore-installed
pip install tensorflow

@rickykim93 you are awesome... I love you...

That worked for me too. Fantastic !!!

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

this worked for me.
thanks a lot to the genius developers

pip install wrapt --upgrade --ignore-installed
pip install tensorflow --upgrade

So Nice! this worked for me too on Ubunto :)

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me too ! Thank you very much!
My environment is windows 10

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

this works for me, Linux64, python3.7, with pip20.0.2 under conda self-defined enviromnet

From all the solutions named here. This one is the only one that worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

This worked in Mac

This worked for me:

pip install wrapt --upgrade --ignore-installed
pip install tensorflow

I tried this and the tensorflow was successfully installed, but I had error when tired to use it. Than I tried
pip install --upgrade tensorflow==2.0.0-beta1
and after this, it works well!

conda uninstall wrapt
pip install tensorflow

Thank you man, this worked for me!

Worked for Ubuntu 16.04 x86_64

When I perform the command "pip install tensorflow-gpu==1.15", I encounter the error "Found existing installation: wrapt 1.10.11 ERROR: Cannot uninstall 'wrapt'".

my solution:

  1. perform "pip install wrapt --upgrade --ignore-installed", upgrade wrapt 1.10.11 to wrapt-1.12.0
  2. perform "pip install tensorflow-gpu==1.15"

if you cannot perform "pip install tensorflow-gpu==1.15" successfully. Maybe you firstly need to upgrade pip-18.1 to pip-20.0 using "python -m pip install --upgrade pip setuptools".

This worked for me. I am using Jupyter notebook (OD: Ubuntu 16.0) all the commands running from the notebook:

At the time of installing tensor flow I got following two errors. The errors and solutions are:
ERROR 1: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Solution: run following command
!conda remove wrapt --yes

ERROR 2: tensorboard 1.14.0 has requirement setuptools>=41.0.0
Solution: run following command to solve this error
!pip uninstall -y setuptools
!pip install setuptools>=41.0.0

Now install tensorflow:
!pip install tensorflow

It worked for me , thank you

It's worked for me as well. Really appreciated for providing such details. However, could you please provide more details regarding the problem? Why we are not able to uninstall "wrapt" without upgrading all the packages and libraries? @Elmit2015

Locking conversation to prevent a stream of "it works"

Was this page helpful?
0 / 5 - 0 ratings