-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode issues/support? #78
Comments
Fixes #78 This avoids encoding issues on Windows where the default encoding is `cp1252` instead of `utf-8`. See https://docs.python.org/3/library/codecs.html#encodings-and-unicode for reference.
@Lindt8 Looks like the package has some problems when writing the converted notebook on Windows. It turns out that the default I've opened #84 to fix this issue by explicitly specifying the encoding for all Reference: https://docs.python.org/3/library/codecs.html#encodings-and-unicode If you're still running into conversion bugs, please link your notebook so I can take a closer look. |
Also, nbinteract has import matplotlib.pyplot as plt
from random import random
def plot_stuff(n_points):
xs = [random() for _ in range(n_points)]
ys = [random() for _ in range(n_points)]
plt.plot(xs, ys)
interact(plot_stuff, n_points=(0, 10)) |
I am having the same issue as presented in #74 , but I have tried the workaround listed at #77 and came across an interesting error (see Jupyter terminal output below).
I am using unicode characters in my notebook (though, I am not using copied characters, I am using the decimal code in HTML/markdown, like
²
, or the Python equivalent,\u00B2
, where appropriate). Does nbinteract support unicode? (and, if not will it eventually?) Oddly, the unicode character referenced in the error,\u2265
(the greater-than or equal to sign), is not one I used anywhere in my notebook. When looking at my notebook in Notepad++, that character was not located in the 424231st position like the error states either.I am still very new to all of this, so it's possible I have goofed somewhere too. Thanks!
(Also, does/will nbinteract have matplotlib support? I don't see matplotlib listed anywhere in your documentation, so perhaps my use of it is what is causing this error?)
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS D:\Google Drive\Sync Locally\SHAEDIT> nbinteract -s Lindt8/SHAEDIT/master SHAEDIT.ipynb
?[0;34m[nbinteract] ?[0mConverting notebooks to HTML...
Traceback (most recent call last):
File "c:\users\hunter\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec)
File "c:\users\hunter\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File "C:\Users\Hunter\Anaconda3\Scripts\nbinteract.exe\__main__.py", line 9, in <module>
File "c:\users\hunter\anaconda3\lib\site-packages\nbinteract\cli.py", line 166, in main run_converter(arguments)
File "c:\users\hunter\anaconda3\lib\site-packages\nbinteract\cli.py", line 203, in run_converter images_folder=arguments['--images']
File "c:\users\hunter\anaconda3\lib\site-packages\nbinteract\cli.py", line 449, in convert outfile.write(final_output)
File "c:\users\hunter\anaconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2265' in position 424231: character maps to <undefined>
PS D:\Google Drive\Sync Locally\SHAEDIT>
The text was updated successfully, but these errors were encountered: