【问题标题】:What is the reason of error in importing Numpy though it installed correctly尽管安装正确,但导入 Numpy 时出错的原因是什么
【发布时间】:2020-06-27 20:18:05
【问题描述】:
when import numpy the following error was occur
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/numpy/core/__init__.py", line 24, in <module>
    from . import multiarray
  File "/usr/local/lib/python3.5/dist-packages/numpy/core/multiarray.py", line 14, in <module>
    from . import overrides
  File "/usr/local/lib/python3.5/dist-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: /usr/local/lib/python3.5/dist-packages/numpy/core/_multiarray_umath.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: cblas_sgemm

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/usr/local/lib/python3.5/dist-packages/numpy/core/__init__.py", line 54, in <module>
    raise ImportError(msg)
ImportError: 

重要提示:请阅读本文以获取有关如何解决此问题的建议!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.5 from "/usr/bin/python3.5",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.1" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

原始错误是:/usr/local/lib/python3.5/dist-packages/numpy/core/_multiarray_umath.cpython-35m-arm-linux-gnueabihf.so:未定义符号:cblas_sgemm

【问题讨论】:

  • 您是否按照错误消息中的说明进行操作:尝试卸载并重新安装 numpy 并检查 PATH 和 PYTHONPATH?

标签: numpy import python-3.5


【解决方案1】:

如错误消息中所述,此错误有很多可能的原因,但使用pip--no-use-pep517 选项对我有帮助。

【讨论】:

    猜你喜欢
    • 2014-01-29
    • 1970-01-01
    • 2015-08-18
    • 2021-12-24
    • 1970-01-01
    • 1970-01-01
    • 2016-09-10
    • 2019-08-15
    • 1970-01-01
    相关资源
    最近更新 更多