Inline plots do not seem to be working in my current configuration. Maybe a version thing?
It looks like IPython is giving is a string which is failing to decode. If you open visualstudio_ipython_repl.py (it’s where PTVS is installed) and modify write_data to add the 2 green lines:
def write_data(self, data, execution_count = None):
output_png = data.get('image/png', None)
if output_png is not None:
if isinstance(output_png, str) and sys.version_info >= 3:
output_png = output_png.encode('utf8')
Then it should work.
It seems odd to me that they’re giving us a string, and I can’t be certain that utf8 is the right encoding, but it appears to be working. I’ll ping the IPython devs and see if that’s right or what’s going on here.
Thanks for the quick fix Dino. It made my demo just now a lot prettier.
There’s one other py3 related change I needed to make:
def execute_file_as_main(self, filename):
f = open(filename, 'rb')
contents = f.read().replace(b"\r\n", b"\n")
code = '''