原因分析:
Python导入模块的方法有两种:

import module 和 from module import

区别是前者所有导入的东西使用时需加上模块名的限定,而后者则不需要

例:

>>>import pprint

>>>pprint.pprint(people)

OR

>>>from pprint import *

>>>pprint(people)

python 报错——Python TypeError: 'module' object is not callable 原因分析的更多相关文章

  1. TypeError: 'module' object is not callable 原因分析

    程序代码 class Person: #constructor def __init__(self,name,sex): self.Name = name self.Sex = sex def ToS ...

  2. Python TypeError: 'module' object is not callable 原因分析

    今天尝试使用pprint进行输出,语句为 >>>import pprint >>>pprint(people) 结果报错,TypeError: 'module' o ...

  3. python报错:TypeError: 'int' object is not subscriptable

    检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如:   a = 4   c=a[2] 报错:line 2, in <module>    c=a[2] TypeError: 'i ...

  4. pip安装pillow——死循环:[WinError5] & [TypeError:'module' object is not callable]

    1.这次本来要安装个pillow,记得以前装了的,怎么这次就不行了.然后,下意识的使用:pip3 install pillow. 发现报错: [TypeError:'module' object is ...

  5. TypeError: 'module' object is not callable cp fromhttp://blog.csdn.net/huang9012/article/details/17417133

    程序代码  class Person:      #constructor      def __init__(self,name,sex):           self.Name = name   ...

  6. python -- TypeError: 'module' object is not callable

    文件: 代码: import pprintmessge = 'It was a bringht cold day in April,and the clocks were striking thrir ...

  7. PyCharm+selenium环境搭建报错:Traceback (most recent call last): TypeError: 'module' object is not callable

    环境搭建好后,代码如下: from selenium import webdriverdriver = webdriver.chrome()driver.get("http://www.ba ...

  8. pip install 报错 TypeError: 'module' object is not callable

    $ pip install filetype Traceback (most recent call last): File "/usr/local/bin/pip2", line ...

  9. python import 错误 TypeError: 'module' object is not callable

    python import 错误 TypeError: 'module' object is not callable 在这里,有 Person.py test.py; 在 test.py 里面 im ...

随机推荐

  1. less css下载及编绎工具

    http://www.lesscss.net less.js下载 LESS 1.5已经放出Beta 1版本,支持source map等新特性,欢迎尝鲜.详细变更请见更新日志. 生产环境使用建议下载1. ...

  2. SpringBoot整合Quartz

    1.引入quzrtz <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId> ...

  3. neocomplcache 自动补全

    key description ctrl+n 当前词补全项,下一个 ctrl+p 当前词补全项,上一个 :help NERDTree NERDTree帮助手册

  4. npm安装vue-cil出现错误

    这个错误有点尴尬..... 之前全局安装过cil,然后在全局安装出现了这个错误,各种手册看了半天也没有头绪,猛然想起来之前安装过,试下直接初始化项目试一下,果然成功了 然后在 npm install ...

  5. flex初始化方法

    initalize是初始化,creationcomplete是创建完成,applicationComplete是应用程序中所有的实例都创建完成后才执行,三者的执行顺序是intalize creatio ...

  6. 探讨电子商务新的商业模式O2O

    在当前的市场经济大环境下,电子商务成为了众 多中小企业用以开拓市场的主要工具,成为突破企业管理瓶颈的重要手段.必卖电子商务顾问认为,电子商务应该是是线上业务与线下业务的结合.对于从线下渠道 起家的传统 ...

  7. 【OC学习-13】什么是组合,它和继承是什么关系?

    继承有两缺点:(1)当层级越来越多时,假如每一个层级都有实例变量,那么最下层的子类继承的实例变量会超级多,沉重.(2)当消息传递自子类往上时.层级越多,效率越低下. 所以就有了组合.说实话区分继承和组 ...

  8. Android-ViewPagerIndicator框架使用——使用概要

    概要:关于ViewPagerIndicator这个框架,我这里只讲解如何使用,而不去讲解他是如何实现的,所以想了解源码剖析的朋友,这个就可以略过了. ViewPagerIndicator这个框架通过自 ...

  9. vmware 安装配置 ,记住这一次不要再问我了。ok?

    Linux 安装配置 ,记住这一次不要再问我了.ok? 第一步 选择版本 如果遇到问题无法自动获取的  老男孩教育-李泳谊<youjiu_linux@qq.com> 17:51:43明天开 ...

  10. UIAlertController custom font, size, color

    本文转载至 http://stackoverflow.com/questions/26460706/uialertcontroller-custom-font-size-color up vote2d ...