dunovank / jupyter-themes

Custom Jupyter Notebook Themes
MIT License
9.74k stars 1.06k forks source link

Errors trying to install themes #383

Open sn-ekstrand opened 4 years ago

sn-ekstrand commented 4 years ago

First, thank you for making this. It looks great and I'm eager to get it up and running.

I am running python 3.7 and as far as I can see I am running the required versions of everything else.

Looking at some other posts, I decided to add the following code to my .bashrc and it didn't help. echo $PYTHONPATH="/home/sean/anaconda3/bin/python"

First I get a FileNotFoundError: [Errno 2] and a PermissionError: [Errno 13]

Traceback (most recent call last):
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/stylefx.py", line 459, in reset_default
    delete_font_files()
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/stylefx.py", line 104, in delete_font_files
    for fontfile in os.listdir(jupyter_custom_fonts):
FileNotFoundError: [Errno 2] No such file or directory: '/home/sean/.jupyter/custom/fonts'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sean/anaconda3/bin/jt", line 10, in <module>
    sys.exit(main())
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/__init__.py", line 314, in main
    dfonts=args.defaultfonts)
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/__init__.py", line 59, in install_theme
    stylefx.reset_default(False)
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/stylefx.py", line 461, in reset_default
    check_directories()
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/stylefx.py", line 60, in check_directories
    os.makedirs(jupyter_custom)
  File "/home/sean/anaconda3/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/sean/.jupyter/custom'

After that I decided to manually add the folders 'custom' and 'fonts' and the file custom.css (which is not there already). It got rid of the [Errno 2] but the [Errno 13] persists. (I was going to try to manually add the required files to the fonts folder and the information to custom.css but that is beyond my current skill level.) Also, nothing gets installed into the fonts folder.

Traceback (most recent call last):
  File "/home/sean/anaconda3/bin/jt", line 10, in <module>
    sys.exit(main())
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/__init__.py", line 314, in main
    dfonts=args.defaultfonts)
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/__init__.py", line 59, in install_theme
    stylefx.reset_default(False)
  File "/home/sean/anaconda3/lib/python3.7/site-packages/jupyterthemes/stylefx.py", line 464, in reset_default
    copyfile(defaultCSS, jupyter_customcss)
  File "/home/sean/anaconda3/lib/python3.7/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/home/sean/.jupyter/custom/custom.css'

Does anybody know what I might be able to do to make things work?

SangamSwadiK commented 4 years ago

@sn-ekstrand Did you try running it with sudo ?

sn-ekstrand commented 4 years ago

@sn-ekstrand Did you try running it with sudo ?

I did and the response was... sudo: jt: command not found