看來我的點子壞了:
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:~$
為什么我不能卸載numpy?
編輯:不確定它是否相關,但我安裝了 OpenVINO
EDIT2:我嘗試了建議的解決方案,但它不起作用:
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:我正在嘗試安裝,因為我在使用 numpy 時遇到了一些問題。我認為有不同的版本,比較:
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'.
和
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:我不能使用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'
uj5u.com熱心網友回復:
因為你的 numpy 安裝要么壞了,要么沒有被 pip 處理:
ERROR: Cannot uninstall numpy 1.19.5, RECORD file not found.
要么采用提供的蠻力解決方案,要么追蹤 numpy 檔案的實際來源——看看你的 PYTHONPATH。
uj5u.com熱心網友回復:
最終的解決方案是直接洗掉 numpy
rm -rf ~/.local/lib/python/site-packages/numpy
pip install numpy
但首先你應該檢查你使用哪個 python 并找到你的站點包路徑
uj5u.com熱心網友回復:
看來我修復了:
pip3 install --user --force-reinstall --no-deps numpy==1.19.5
至少這讓 numpy 和 numba 作業。
uj5u.com熱心網友回復:
- 您可以使用此命令查找已安裝的軟體包
pip freeze - 我建議你使用虛擬環境
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/312469.html
上一篇:如何優雅設計mybtis工具類及實作分頁查詢,動態SQL&mybatis+struts組合使用
下一篇:eclipse啟動器不存在
