Jupyter-themes: Unable to change theme - UnicodeDecodeError is produced

Created on 9 Jan 2018  路  8Comments  路  Source: dunovank/jupyter-themes

The following error is produced when running jt -t grade3 using version 0.18.3 (latest versions of dependencies are installed)

(python3) xyz@xyz~$ jt -t grade3
Traceback (most recent call last):
File "/Users/xyz/.virtualenvs/python3/bin/jt", line 11, in
sys.exit(main())
File "/Users/xyz/.virtualenvs/python3/lib/python3.6/site-packages/jupyterthemes/__init__.py", line 305, in main
dfonts=args.defaultfonts)
File "/Users/xyz/.virtualenvs/python3/lib/python3.6/site-packages/jupyterthemes/__init__.py", line 98, in install_theme
nbname=nbname)
File "/Users/xyz/.virtualenvs/python3/lib/python3.6/site-packages/jupyterthemes/stylefx.py", line 291, in style_layout
style_less += notebook.read() + '\n'
File "/Users/xyz/.virtualenvs/python3/bin/../lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41269: ordinal not in range(128)

Most helpful comment

downgrading to version 0.18.2 works OK
pip3 install --no-dependencies jupyterthemes==0.18.2

All 8 comments

same here...

downgrading to version 0.18.2 works OK
pip3 install --no-dependencies jupyterthemes==0.18.2

@ravicheema
Hi, I have the same problem, and I have tried it in this way, but it doesn't work. I use Python2.7.14.

I would appreciate it if you could give me some advice.

Thanks!

I have soved the problem, thanks!

Traceback (most recent call last): File "g:\python\python2.7.14\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "g:\python\python2.7.14\lib\runpy.py", line 72, in _run_code exec code in run_globals File "G:\Python\Python2.7.14\Scripts\jt.exe\__main__.py", line 9, in <module> File "g:\python\python2.7.14\lib\site-packages\jupyterthemes\__init__.py", line 305, in main dfonts=args.defaultfonts) File "g:\python\python2.7.14\lib\site-packages\jupyterthemes\__init__.py", line 58, in install_theme stylefx.reset_default(False) File "g:\python\python2.7.14\lib\site-packages\jupyterthemes\stylefx.py", line 394, in reset_default custom = '{0}{1}{2}.css'.format(fpath, os.sep, 'custom') UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-11: ordinal not in range(128)

The solution in #218 works for me. Just replace notebook.less with the converted version in site-packages/jupyterthemes/layout. On MacOS (homebrew), site-packages is located in /usr/local/lib/python3.6/

D:\software package>jt -t oceans16
Traceback (most recent call last):
File "d:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Anaconda3\Scripts\jt.exe__main__.py", line 9, in
File "d:\anaconda3\libsite-packages\jupyterthemes__init__.py", line 305, in main
dfonts=args.defaultfonts)
File "d:\anaconda3\libsite-packages\jupyterthemes__init__.py", line 98, in install_theme
nbname=nbname)
File "d:\anaconda3\libsite-packages\jupyterthemes\stylefx.py", line 291, in style_layout
style_less += notebook.read() + '\n'
UnicodeDecodeError: 'gbk' codec can't decode byte 0x8b in position 41271: illegal multibyte sequence

please help me.thx

Would someone mind upgrading to version 0.18.8 to see if this is fixed? And could you report your results back here? Thanks!

pip install --upgrade jupyterthemes

Hello @dunovank - yes this issue is now fixed in version 0.18.8, no errors when I switch themes. Many thanks.

(python3) ravi@Ravis-iMac~$ pip freeze | grep jupyterthemes
jupyterthemes==0.18.8
(python3) ravi@Ravis-iMac~$ jt -t grade3 -fs 10 -cellw 100% -T
(python3) ravi@Ravis-iMac~$

Was this page helpful?
0 / 5 - 0 ratings

Related issues

meowklaski picture meowklaski  路  9Comments

ShriRambo picture ShriRambo  路  6Comments

Brenndoerfer picture Brenndoerfer  路  6Comments

Brett99 picture Brett99  路  7Comments

Peydon picture Peydon  路  3Comments