In pyvis, Why I get this error when I am trying to visualise a simple graph (3 lines of codes only)?
net=Network(notebook=True, cdn_resources='in_line')
net.from_nx(nx.davis_southern_women_graph())
net.show('example.html')
This leads to the error:
Traceback (most recent call last):
File "g:\My Drive\....\graph_v.py", line 270, in <module>
net.show('example.html')
File "C:\Users\ziton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyvis\network.py", line 546, in show
self.write_html(name, open_browser=False,notebook=True)
File "C:\Users\ziton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyvis\network.py", line 530, in write_html
out.write(self.html)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 263607-263621: character maps to <undefined>
Some research yielded that I need to update the encoding to UTF-8 but when calling which method and how?