Python# 小白求助

lianm_R 2020-01-07 04:11:52
作为一个新接触Python的小白,在用pycharm执行程序时报如下错误:

C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe "F:\PyCharm 2018.3.5\helpers\pydev\pydevconsole.py" --mode=client --port=59966
Traceback (most recent call last):
File "F:\PyCharm 2018.3.5\helpers\pydev\pydevconsole.py", line 33, in <module>
from _pydev_bundle.pydev_console_utils import BaseInterpreterInterface
File "F:\PyCharm 2018.3.5\helpers\pydev\_pydev_bundle\pydev_console_utils.py", line 11, in <module>
from _pydevd_bundle import pydevd_thrift
File "F:\PyCharm 2018.3.5\helpers\pydev\_pydevd_bundle\pydevd_thrift.py", line 17, in <module>
from pydev_console.protocol import DebugValue, GetArrayResponse, ArrayData, ArrayHeaders, ColHeader, RowHeader, \
File "F:\PyCharm 2018.3.5\helpers\pydev\pydev_console\protocol.py", line 6, in <module>
_console_thrift = _shaded_thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "console.thrift"),
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_thriftpy\parser\__init__.py", line 29, in load
thrift = parse(path, module_name, include_dirs=include_dirs,
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_thriftpy\parser\parser.py", line 502, in parse
parser.parse(data)
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_ply\yacc.py", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_ply\yacc.py", line 1106, in parseopt_notrack
p.callable(pslice)
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_thriftpy\parser\parser.py", line 212, in p_struct
val = _fill_in_struct(p[1], p[3])
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_thriftpy\parser\parser.py", line 765, in _fill_in_struct
gen_init(cls, thrift_spec, default_spec)
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_thriftpy\thrift.py", line 103, in gen_init
cls.__init__ = init_func_generator(default_spec)
File "F:\PyCharm 2018.3.5\helpers\third_party\thriftpy\_shaded_thriftpy\_compat.py", line 102, in init_func_generator
new_code = types.CodeType(len(varnames),
TypeError: an integer is required (got type bytes)
Process finished with exit code 1

请各位大神不吝赐教啊!!
...全文
142 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
nangongxiaobai 2020-01-07
  • 打赏
  • 举报
回复
用python3运行了一个在pycharm路径下的文件:pydevconsole.py。就是generate那句的原因吧。 我写了一些python代码,没有用过这个wordcloud库,坐等大神来解决。
lianm_R 2020-01-07
  • 打赏
  • 举报
回复
发现描述的不是很仔细,再补充下我的代码,具体报错查不出来

from wordcloud import WordCloud
import PIL.Image as image

with open("F:\\pythoneg\\wordcloud1.txt") as fp:
text = fp.read()
WordCloud = WordCloud().generate(text)
image_produce = WordCloud.to_image()
image_produce.show()
nangongxiaobai 2020-01-07
  • 打赏
  • 举报
回复
TypeError: an integer is required (got type bytes) 你调用的方法需要传入一个int类型的参数。

37,720

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧