python 3.x - Pygal Module Not Working -
in trying run simple code has outputs histogram, keep getting following error:
traceback (most recent call last): file "c:\tmp\die_visual.py", line 1, in <module> import pygal file "c:\users\christopher\appdata\roaming\python\python36\site-packages\pygal\__init__.py", line 33, in <module> pygal.graph.bar import bar file "c:\users\christopher\appdata\roaming\python\python36\site-packages\pygal\graph\__init__.py", line 24, in <module> .__about__ import * # noqa: f401,f403 modulenotfounderror: no module named 'pygal.graph.__about__'
i have moved file requires pygal same directory , same error.
this code have entered.
import pygal die import die # create d6. die = die() # make rolls, , store results in list. results = [] roll_num in range(1000): result = die.roll() results.append(result) # analyze results frequencies = [] value in range(1, die.num_sides+1): frequency = results.count(value) frequencies.append(frequency) # visualize results. hist = pygal.bar() hist.title = "results of rolling 1 d6 1000 times." hist.x_labels = ['1', '2', '3', '4', '5', '6'] hist.x_title = "result" hist.y_title = "frequency of result" hist.add('d6', frequencies) hist.render_to_file('die_visual.svg')
wiki
Comments
Post a Comment