I am trying to install Tensorflow 2.3 on the raspberry pi 4 2GB using this guide (https://itnext.io/installing-tensorflow-2-3-0-for-raspberry-pi3-4-debian-buster-11447cb31fc4) but I keep getting the error: 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.

I have tried using pip install wrapt --upgrade --ignore-installed. It then installs wrapt 1.12 but when I try to install Tensorflow the wrapt 1.10 version gets picked up and I get the same error.

Any help would be appreciated.

PS. I want to use tflite to run my models, but need tensorflow as I am using keras for preprocessing the images which requires tensorflow 2.2 at least. If anyone can guide me in a direction to perform the below processing without keras I would not need to install Tensorflow and I can avoid this error.

    test_image = image.img_to_array(test_image)
    test_image = np.expand_dims(test_image, axis = 0)
    processed_image = tf.keras.applications.efficientnet.preprocess_input(test_image)```
  • 3
    Requirements state Python 3 but you used pip in your question which is for Python 2... maybe using pip3 will solve some of the issues (or it was a typing error)?
    – user115418
    Sep 29 '20 at 16:14

Remove file wrapt-1.10.11.egg-info by command sudo rm /usr/lib/python3/dist-packages/wrapt-1.10.11.egg-info

Then install tensorflow again sudo -H pip3 install tensorflow-2.3.0-cp37-none-linux_armv7l.whl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.