python中使用numpy包错误AttributeError: module ‘numpy‘ has no attribute ‘random‘

AttributeError: module ‘numpy’ has no attribute ‘random’
程序出现以下错误:(文件名称不能和常用的包取同样的名字)
在这里插入图片描述
把numpy文件名改掉就可以了
应该注意修改名字后 程序里会把numpy自动修改为新名字,这时需要手动修改包名
在这里插入图片描述
修改后就可以正常运行啦
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_41238751/article/details/108648078