V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
337136897
V2EX  ›  Python

Python 在写一个制作个性签名云图时出现了一个错误

  •  
  •   337136897 · 2017-07-26 22:30:04 +08:00 · 2319 次点击
    这是一个创建于 2459 天前的主题,其中的信息可能已经有所发展或是发生改变。
    某一句代码:
    my_wordcloud=WordCloud(background_color='white',max_words=2000,
    mask=coloring,max_font_size=60,random_state=42,scale=2,
    font_path="i:simhei.ttf").generate(word_space_split)

    运行时提示错误: File "c:\WeChatOutputSignature.py", line 50, in <module>
    font_path="c:/Windows/Font/simhei.ttf").generate(word_space_split)
    TypeError: 'module' object is not callable


    求大佬们指点一下,这下我
    2 条回复    2017-07-26 23:40:09 +08:00
    337136897
        1
    337136897  
    OP
       2017-07-26 22:33:26 +08:00
    请问怎样上传文件
    zhanglintc
        2
    zhanglintc  
       2017-07-26 23:40:09 +08:00
    别的不清楚, 只看报错信息的话:

    TypeError: 'module' object is not callable

    这里看起来说明它不是一个函数或者方法, 你要检查一下 WordCloud 或者 generate, 看看他们是不是一个能够被调用的函数?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1102 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:32 · PVG 07:32 · LAX 16:32 · JFK 19:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.