尝试时:
$ sudo dpkg -i python-numpy_1.13.3-2ubuntu1_amd64.deb
...
dpkg: dependency problems prevent configuration of python-numpy:
python-numpy depends on python (>= 2.7~); however:
Package python is not installed.
python-numpy depends on python (<< 2.8); however:
Package python is not installed.
python-numpy depends on python:any (>= 2.7.5-5~); however:
python-numpy depends on python:any (<< 2.8); however:
在同一目录中执行以下操作:
$ python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ which python
/usr/bin/python
如何解决 dpkg 错误?
操作系统是 Ubuntu18.04 LTS,我下载了相关的 numpy 版本。
机器未连接到互联网。
答案1
dpkg 错误有点误导,缺少的不是 python,而是 python-dev。安装 python-dev 及其所有依赖项。
答案2
我建议用此代码来解决依赖问题
sudo apt-get install -f
如果依赖的 .deb 文件位于 Linux 存储库中,这可能会解决你的问题