0

I want to uninstall numpy in Python 3.8. I tried to that command "pip3 uninstall numpy",but this didn't work. I modified the PYTHONPATH in my ~/.bashrc file and exported PYTHONPATH, but when I again install the nump, "Requirement already satisfied: numpy in/usr/lib/python3/dist-packages(1.17.4)" output in console.

type here

~$ pip3 uninstall numpy
Found existing installation: numpy 1.24.1
Uninstalling numpy-1.24.1:
  Would remove:
    /home/efsun/.local/bin/f2py
    /home/efsun/.local/bin/f2py3
    /home/efsun/.local/bin/f2py3.8
    /home/efsun/.local/lib/python3.8/site-packages/numpy-1.24.1.dist-info/*
    /home/efsun/.local/lib/python3.8/site-packages/numpy.libs/libgfortran-040039e1.so.5.0.0
    /home/efsun/.local/lib/python3.8/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so
    /home/efsun/.local/lib/python3.8/site-packages/numpy.libs/libquadmath-96973f99.so.0.0.0
    /home/efsun/.local/lib/python3.8/site-packages/numpy/*
Proceed (y/n)? y
  Successfully uninstalled numpy-1.24.1
~$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.17.4)
~$ nano ~/.bashrc
~$ PYTHONPATH
PYTHONPATH: command not found
~$ nano ~/.bashrc
~$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.17.4)
~$ nano ~/.bashrc
~$ source ~/.bashrc
~$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.17.4)
~$ nano ~/.bashrc
~$ source ~/.bashrc
~$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.17.4)

1 Answer 1

0

Setting PYTHONPATH will not affect package installation, and I would really advise against PYTHONPATH hacks in your bashrc, because you'll inevitably forget about them and wonder what the absolute heck is going on later.

pip install numpy is saying that because you already have a system-wide installation of NumPy 1.17.4 in /usr/lib/python3/dist-packages (likely installed with apt), and just "I want numpy to be installed" is satisfied with that.

If you tried pip install -U numpy, it would attempt to upgrade Numpy to the latest version, and likely install it to your .local directory because it can't write to your dist-packages. But don't do that either – just use a virtualenv and install the packages for your project there.

In short,

$ python3.8 -m venv my-venv
$ source my-venv/bin/activate
$ pip install numpy
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.