0

I am setting up a Big Data cluster and am using Python 2.7.5 (Spark cannot not use Python 3). The servers that I am running are command line based Centos 7 and I am installing python modules using pip version 20.0.2. I have installed numpy version 1.16.1 but python would only import version 1.7.1. I was able to uninstall 1.16.1 but not 1.7.1. When I tried to uninstall again I would receive the following error.

Found existing installation: numpy 1.7.1 ERROR: Cannot uninstall 'numpy'. 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 to manually delete numpy from /lib/python2.7/site-packages but the folder does not exist. After trying to import numpy in python again it could not find numpy.

Traceback (most recent call last): File "", line 1, in ImportError: No module named numpy

However, I was still unable to install numpy 1.16.1 because of the dependency error with 1.7.1.

I am not looking in the right place to manually delete the numpy module or is there a way I can force update or force delete numpy?

This question may seem like a duplicate to this question but I have tried the answers, however, with no success.

  • Spark does can use Python 3, e.g. see this question: https://stackoverflow.com/questions/30279783/apache-spark-how-to-use-pyspark-with-python-3 – Hollay-Horváth Zsombor Feb 18 '20 at 23:03
  • I am using spark 2.4 and some of the other software that will be used cannot run on anything higher than python 2.7. The point is I need a solution in Python 2.7. – TravisTeague01 Feb 19 '20 at 00:33

1 Answers1

0

Here is a solution. Yum will forcefully uninstall any packages and their dependencies. Using the rpm -q command you can find the package name that can then be uninstalled with yum remove.

rpm -q numpy
numpy-1.7.1-13.el7.x86_64
yum remove numpy-1.7.1-13.el7.x86_64

This will successfully remove the old version of numpy and any dependencies associated with it.

Checking installed packages

Uninstalling Packages