ImportError:无法从“ numpy.core”(未知位置)导入名称“ array”

时间:2019-03-21 00:42:10

标签: python python-3.x numpy

我突然收到此错误(今天早些时候一切正常)

ImportError: cannot import name 'array' from 'numpy.core' (unknown location)

这是罪魁祸首:

import functools
import operator
import warnings

from numpy.core import (
    array, asarray, zeros, empty, empty_like, intc, single, double,
    csingle, cdouble, inexact, complexfloating, newaxis, all, Inf, dot,
    add, multiply, sqrt, fastCopyAndTranspose, sum, isfinite,
    finfo, errstate, geterrobj, moveaxis, amin, amax, product, abs,
    atleast_2d, intp, asanyarray, object_, matmul,
    swapaxes, divide, count_nonzero, isnan
)
from numpy.core.multiarray import normalize_axis_index
from numpy.core.overrides import set_module
from numpy.core import overrides
from numpy.lib.twodim_base import triu, eye
from numpy.linalg import lapack_lite, _umath_linalg

我要做的全部选择此项,然后按F9键:

import numpy as np

我卸载并重新安装了numpy。我用Google搜索了一个解决方案,但没有找到太多。这里有人遇到过吗?对做什么有什么想法?谢谢。

1 个答案:

答案 0 :(得分:-2)

您可能需要先import numpy,然后再使用from numpy import ()