我突然收到此错误(今天早些时候一切正常)
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搜索了一个解决方案,但没有找到太多。这里有人遇到过吗?对做什么有什么想法?谢谢。
答案 0 :(得分:-2)
您可能需要先import numpy
,然后再使用from numpy import ()