![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python报错
学习中遇到的报错
cyan_orange
这个作者很懒,什么都没留下…
展开
-
python错误:TypeError: Cannot interpret ‘3‘ as a data type
下面错误:错误:无法将3当作一个数据类型,那么我们可以知道肯定是缺少了参数,查看np.ones的参数如下:改为这样就可以了: c = np.ones((2,3,4))原创 2021-08-15 21:44:31 · 17187 阅读 · 2 评论 -
python编程出现:expected an indented block错误。
python编程出现:expected an indented block错误。expected an indented block翻译为:应为缩进块。python中没有像C语言使用{}来表示从属关系,而是使用缩进表示上下级关系。导致excepted an indented block这个错误的原因一般有两个:冒号后面是要写上一定的内容的,例如:for循环后面不写任何代码缩进不规范,少些或多些了一个空格缩进之后就没有报错了...原创 2021-01-30 01:37:14 · 96983 阅读 · 2 评论 -
关于命令pip的使用和No module named ‘pip’
查看所有安装库的版本pip list查看某个库的版本pip show numpy#要哪个库就写哪个名字安装某个库pip install turtle(直接安装,但是速度慢,需要科学上网)下面介绍通过国内镜像网站安装:pip install matplotlib -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com可以将matplotlib换成想要安装的其他库,下载速度直接上天.在网上还收集了其他的一些镜像网站,如下.原创 2021-01-29 21:37:16 · 266 阅读 · 0 评论