作為一個新接觸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
請各位大神不吝賜教啊!!
uj5u.com熱心網友回復:
TypeError: an integer is required (got type bytes)你呼叫的方法需要傳入一個int型別的引數。
uj5u.com熱心網友回復:
發現描述的不是很仔細,再補充下我的代碼,具體報錯查不出來
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()
uj5u.com熱心網友回復:
用python3運行了一個在pycharm路徑下的檔案:pydevconsole.py。就是generate那句的原因吧。我寫了一些python代碼,沒有用過這個wordcloud庫,坐等大神來解決。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/105037.html
上一篇:分享一個GoLang的公眾號
