【问题标题】:Numpy import error "ImportError: Something is wrong with the numpy installation."Numpy 导入错误“ImportError:numpy 安装有问题。”
【发布时间】:2020-04-04 10:37:09
【问题描述】:
Traceback (most recent call last):
  File "extract_C3D_feature.py", line 7, in <module>
    import numpy as np
  File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 91, in <module>
    raise ImportError(msg.format(path))
ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['/usr/local/lib/python2.7/dist-packages/numpy']. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.

我尝试卸载和安装,但可能我遗漏了一些东西

【问题讨论】:

    标签: python numpy numpy-ndarray


    【解决方案1】:

    试试 sudo pip uninstall numpy 重复直到你清除所有 numpy 版本。 如果你使用 python3,将 pip 替换为 pip3。

    如果这也不起作用,看来 python 正在寻找 numpy 包而不是 numpy 安装。遵循 bash 中错误处理程序的建议并卸载 numpy 不会删除错误,因为 python 仍然可以看到已卸载的包。 如果其他一些应用程序需要这些版本的 numpy,暂时只需将它们移动到 python 找不到它们的桌面上。这应该可以解决错误。

    在使用 python3 时,您可能需要使用 'pip3 install numpy'。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-30
      • 1970-01-01
      • 2015-12-13
      • 1970-01-01
      • 2020-02-13
      • 2015-10-05
      • 1970-01-01
      • 2017-06-08
      相关资源
      最近更新 更多