2

It seems my pip is broken:

ubuntu@ip-x:~$ pip3 uninstall numpy
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Found existing installation: numpy 1.19.5
ERROR: Cannot uninstall numpy 1.19.5, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps numpy==1.19.5'.
ubuntu@ip-x:~$ python3 -m pip uninstall numpy
Found existing installation: numpy 1.19.5
ERROR: Cannot uninstall numpy 1.19.5, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps numpy==1.19.5'.
ubuntu@ip-x:~$ sudo apt remove python3-numpy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'python3-numpy' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 71 not upgraded.
ubuntu@ip-172-30-0-42:~$ 

Why I cannot uninstall numpy?

EDIT: not sure if it could be related but I have OpenVINO installed

EDIT2: I tried the suggested solution, but it does not work:

ubuntu@ip-x:~$ pip3 install --force-reinstall --no-deps numpy==1.19.5
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting numpy==1.19.5
  Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
     |████████████████████████████████| 14.8 MB 6.3 MB/s            
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.19.5
ERROR: Cannot uninstall numpy 1.19.5, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps numpy==1.19.5'.

EDIT3: I am trying to install because I am have some issues with numpy. I think there are different versions, compare:

pip3 uninstall numpy
Found existing installation: numpy 1.19.5
ERROR: Cannot uninstall numpy 1.19.5, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps numpy==1.19.5'.

with

ubuntu@x:~$ python3 -c "import numpy;print(numpy.__version__);print(numpy.__file__)";
1.18.5
/usr/local/lib/python3.6/dist-packages/numpy/__init__.py

EDIT4: I can't use numba:

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting numba
  Downloading numba-0.53.1-cp36-cp36m-manylinux2014_x86_64.whl (3.4 MB)
     |████████████████████████████████| 3.4 MB 7.9 MB/s            
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from numba) (58.1.0)
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.6/dist-packages (from numba) (1.19.5)
Collecting llvmlite<0.37,>=0.36.0rc1
  Downloading llvmlite-0.36.0-cp36-cp36m-manylinux2010_x86_64.whl (25.3 MB)
     |████████████████████████████████| 25.3 MB 128.3 MB/s            
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/dist-packages/numpy-1.19.5.dist-info/METADATA'

4
  • 3
    Have you tried running the suggested command? Commented Oct 12, 2021 at 15:29
  • 1
    incidentally, why are you trying to uninstall numpy? Commented Oct 12, 2021 at 15:31
  • Suggested solution gives me the same error. Commented Oct 12, 2021 at 15:40
  • See above for the reason. Commented Oct 12, 2021 at 15:42

4 Answers 4

1

Because your numpy installation is either broken, or was not handled by pip:

ERROR: Cannot uninstall numpy 1.19.5, RECORD file not found.

Either take the brute force solution provided, or track down where the numpy files actually came from---have a look in your PYTHONPATH.

Sign up to request clarification or add additional context in comments.

Comments

1

It seems I fixed with:

pip3 install --user --force-reinstall --no-deps numpy==1.19.5

At least that got numpy and numba working.

Comments

0

Ultimate solution is removing numpy directrly

rm -rf ~/.local/lib/python/site-packages/numpy
pip install numpy

but first you should check which python do you user and find yout site-packages path

5 Comments

Directory ` ~/.local/lib/python3.6/site-packages/numpy` does not exist.
try to detect your python version
user command "which python"
/usr/bin/python3 but cd ~/.local/lib/python3 does not exist. Only ~/.local/lib/python3.6 exists.
so try to use your path - rm -rf ~/.local/lib/python3.6/site-packages/numpy
-1
  1. You can find installed packages with this command pip freeze
  2. I recommend you to use virtual enviroment

3 Comments

thx i saw apt usage in question and thought that in can be executable package "numpy"
Yes, which numpy returns numpy not found.
i changed command

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.