Skip to content
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

jt command not installing properly #92

Closed
dspoka opened this issue Jan 24, 2017 · 61 comments
Closed

jt command not installing properly #92

dspoka opened this issue Jan 24, 2017 · 61 comments

Comments

@dspoka
Copy link

dspoka commented Jan 24, 2017

Mac OS Sierra 10.13
pip 9.0.1
Python 2.7.13

I used
pip install jupyterthemes

and it seems like it installs successfully but the jt command does not exist.
have tried uninstalling and installing with sudo too.
any help?

@dunovank
Copy link
Owner

Hmm... that's a new one... I'm really not sure.
Does it work if you replace jt with jupyter-theme

as in:
jupyter-theme -t oceans16

@jasonseney
Copy link

jasonseney commented Jan 31, 2017

Update - Not sure if this is the same issue, but I had to restart jupyter after setting this up for it to pick up the custom.css file for the first time.

@dunovank
Copy link
Owner

dunovank commented Jan 31, 2017 via email

@jasonseney
Copy link

@dunovank Thank you for the reply - I actually edited my comment after figuring it out. (Unrelated to typo of theme).

I had to restart my jupyter process and it picked it up no problem after that. I read that it only checks for the custom.css file if it's there on startup. Subsequent changes to the theme work fine after restarting. I didn't have this issue with jupyter-themer because they use an entirely different (perhaps deprecated) location for the custom CSS.

Perhaps it's worth mentioning the restart in the README? Thanks!

@dunovank
Copy link
Owner

dunovank commented Feb 1, 2017

Yes, a long needed addition to the readme. Will do that asap. Thanks again for the feedback!

@sananth12
Copy link

@dspoka I had the same issue, and this worked for me:
(First, uninstall any older versions)

pip install --user git+https://github.com/dunovank/jupyter-themes.git

@dunovank
Copy link
Owner

dunovank commented Feb 4, 2017

Thanks @sananth12 ! Putting a note in the readme about this.

@biographie
Copy link

I've tried uninstalling existing versions and re-installing from the github repo, but I'm still getting " name 'jupyter' is not defined"

I've restarted jupyter as well and nothing seems to be solving the problem. Any suggestions?

@chw946
Copy link

chw946 commented Mar 23, 2017

I've tried following the README instruction:

# uninstall any existing versions
pip uninstall jupyterthemes
# install from the github repo
pip install --user git+https://github.com/dunovank/jupyter-themes.git

but it seems my zsh still complaining

zsh: command not found: jt

Does anyone know how to solve this?

@biographie
Copy link

chw946,
I too am having the same exact problem, and using zsh. Have yet to find a solution

@dunovank
Copy link
Owner

dunovank commented Apr 6, 2017

@biographie what's the output of terminal command: echo $PYTHONPATH

(I'm also using zsh and haven't had any issues. It's been a while but I seem to remember having to manually set my PYTHONPATH to prioritize anaconda packages after installing zsh).

@biographie
Copy link

@dunovank im not getting any output when echo $PYTHONPATH

any ideas on how to go about this?

@dunovank
Copy link
Owner

dunovank commented Apr 7, 2017

disclaimer: messing with PATH variables is always risky so proceed at your own discretion

If you're using anaconda you might try adding the following lines to your .zshrc

# PATH
export PATH="$HOME/anaconda/bin:$PATH"

# PYTHONPATH
export PYTHONPATH="$PYTHONPATH:$HOME/anaconda/bin/"

or replace $HOME/anaconda/bin/ with the path that gets returned when you execute which python

@dunovank
Copy link
Owner

dunovank commented Apr 8, 2017

@biographie any luck with this?

@biographie
Copy link

@dunovank great stuff - it worked!
just one last issue which is off-topic, but using the onedork theme, all the plots i've got in r have a dark overlay. is that they way it's meant to be?

thanks a lot for your help

@dunovank
Copy link
Owner

Glad to hear it. I'm going to mark this as resolved then. Would you mind opening a separate issue about the plots? A screenshot of the issue would also help. Thanks!

@dannaf
Copy link

dannaf commented Apr 19, 2017

I guess this issue closed 3 days ago but as a first time user of jupyterthemes who just encountered it for the first time and followed the instructions in the readme I still ran into this exact problem.

Maybe the following information helps:

I am running on a fresh AWS Linux instance with Python/IPython/Jupyter installed not via Anaconda, and the pip installation (for which I need to use sudo) does seem to work normally during the installation part (before trying it). It results in an installation at /usr/local/lib/python2.7/site-packages/jupyterthemes and a short launcher file at /usr/local/bin/jt. The launcher file seems fine, and it imports main from jupyterthemes. It is there and both locate and which commands find it there.

When I try to run jt and jt -l it works, but on jt -t oceans16 it complains about permission. Then when I run sudo jt -t oceans16 this is when the sudo: jt: command not found (running bash), and which reports which: no jt in (/sbin:/bin:/usr/sbin:/usr/bin). At this point I did sudo /usr/local/bin/jt -t oceans16 and it seemed to work fine.

My conclusion/hypothesis is that the issue is a path issue specifically between sudo and non-sudo invocations, because pip seems to install it to /usr/local/bin while the sudo invocation looks in /sbin:/bin:/usr/sbin:/usr/bin where it doesn't need to find it, and the sudo invocation is necessary for proper permissions for jt -t.

Hope that helps.
Thanks!

Daniel

ps the specific permissions complaint that gets me to use sudo in the first place for jt -t is:

[ec2-user@ip-172-31-44-101 ~]$ jt -t oceans16
Traceback (most recent call last):
  File "/usr/local/bin/jt", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 233, in main
    nbname=args.nbname)
  File "/usr/local/lib/python2.7/site-packages/jupyterthemes/__init__.py", line 82, in install_theme
    style_css = stylefx.less_to_css(style_less)
  File "/usr/local/lib/python2.7/site-packages/jupyterthemes/stylefx.py", line 60, in less_to_css
    with open(tempfile, 'w') as f:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/jupyterthemes/tempfile.less'

@dunovank
Copy link
Owner

Thanks for taking the time to give detailed feedback, very much appreciated. I'll re-open this now.

@dunovank dunovank reopened this Apr 19, 2017
@unnir
Copy link

unnir commented May 1, 2017

just want to say, I've the same issue, the solutions above did not help me.

MacOs, python 3.5, conda.

I

@dunovank
Copy link
Owner

dunovank commented May 1, 2017

Hey @unnir sorry about the trouble. Can you tell me the output of these two shell commands?

echo $PATH
echo $PYTHONPATH
which python

Also, are you using basic bash (default shell in os x terminal) or something like zsh? Just to be clear, you're having the same permissions issue as reported by @dannaf ?

@unnir
Copy link

unnir commented May 10, 2017

@dunovank you don't have to be sorry :) everything is fine, mac is very special

echo $PATH
/Users/vadimborisov/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin

echo $PYTHONPATH

which python
/Users/vadimborisov/anaconda/bin/python

so, I had an empty path for $PYTHONPATH,
I updated it, and now everything works like magic 👍

thank you!

@dunovank
Copy link
Owner

dunovank commented May 11, 2017

Good to hear @unnir , glad it worked.

Just to clarify for anyone who runs into this issue in the future. If you get an error saying that jt has not been installed correctly when trying to install a theme, first check to make sure the prioritized version of python on your system is included in your $PYTHONPATH.

In a terminal

# points to custom python install
$ echo $PYTHONPATH
# path to current prioritized python version
$ which python

If echo $PYTHONPATH doesn't return anything, open up your shell profile and update your $PYTHONPATH to include the one returned by which python.

In your .bashrc (or equivalent)

#ex. if which python returned /home/jingyang/anaconda3/bin/python
export PYTHONPATH="/home/jingyang/anaconda3/bin/python"

Save, open a new terminal session, and retry theme install.

@ghost
Copy link

ghost commented May 19, 2017

Yes, thanks @dunovank. I just installed jupyter-themes, and was having the same issue when I tried to call jt in the terminal, but updating $PYTHONPATH (which was empty) fixed the problem.

@dunovank
Copy link
Owner

closing since this seems to be resolved, thanks everyone!

@rolisanchez
Copy link

For those who still had problems even with correct PATH and PYTHONPATH
I installed jupyter-themes by using the command:

pip install --user

Which is recommended instead of using sudo, but got the zsh: command not found: jt error.

After installing with sudo instead of --user (not recommended) the jt command worked.

@xshi0001
Copy link

Hi , I want to ask a question that is it useful for windows 10 to use these themes?

@unnir
Copy link

unnir commented Dec 16, 2017

@xshi0001 usefulness of something is always up to you.

@ZhangHongdaZWQ
Copy link

Why did my jupyter notebook and the web site post a different picture when I installed it all? I want the same theme as the website, how to set it? Can you help me? Thank you very much!

@wd1969
Copy link

wd1969 commented Mar 9, 2018

Jt works but nothing shows.It seems to be invalid that I have made a lot of efforts. Can I provide an alternative way of operating?For example, the following can be normal.But I also need to open the toolbar and set the font.
Set_nb_theme('chesterish')
hope to help Thank you

@RootofalleviI
Copy link

Hello! After updating my PYTHONPATH variable, the command jt still doesn't work. Could you help me? Thanks! (I'm using Ubuntu 17.10)

@yanghtr
Copy link

yanghtr commented Apr 29, 2018

@RootofalleviI
I also meet the problem.
I think you can use find / -name "jt" to find where is jt
I find my jt is in ~/.local/lib/python3.5/site-packages/bin while my python is in /usr/local/bin
Then I

cd ~/.local/lib/python3.5/site-packages/bin  

python jt -l  

python jt -t oceans16

@namanpaul
Copy link

I am facing the same issue as @RootofalleviI , the PYTHONPATH variable fails to retain the path value. Any help or work around would be much appreciated. I am using Ubuntu 18.04.1 LTS

Thanks!

@nickreader
Copy link

nickreader commented Oct 16, 2018

Hi all,

I used jupyterthemes on a Mac at my work and it has worked fine. I've switched to a Windows and after installing jupyterthemes using pip when I try to set a theme by typing:
! jt -t oceans16

I have been getting this error:

'jt' is not recognized as an internal or external command, operable program or batch file.

I'm on Windows 10, Python 3.7. I have been looking through this thread for fixes but all the suggestions are for Mac. Any idea on how to fix this problem for Windows?

@benfolsom
Copy link

benfolsom commented Oct 25, 2018

I am facing the same issue as @RootofalleviI , the PYTHONPATH variable fails to retain the path value. Any help or work around would be much appreciated. I am using Ubuntu 18.04.1 LTS

Thanks!

@namanpaul I'm also on Ubuntu 18.04.1. Try uninstalling and reinstalling jupyterthemes as sudo, this worked for me.

@namanpaul
Copy link

thanks @benfolsom I was able to resolve the issue on its own: the quick fix was a system restart and things seem to work!

@Marwen-Bhj
Copy link

Marwen-Bhj commented Nov 16, 2018

if any is still struggling with the "jt command not found" on mac ,
these two commands seemed to resolved the issue
conda install -c conda-forge jupyterthemes
conda install -c conda-forge/label/gcc7 jupyterthemes

@pheaktra1
Copy link

Can anyone help me please?
After I installed jupyterthemes, my jupyter server is not responding. I can't use my jupyter right now.
I tried to uninstall jupyterthemes but it's still not responding. (I'm using ubuntu 16.04)
How can i get my jupyter back please?
11
22

@bukhbayar
Copy link

Are we be able to apply it in Github or it is only for local?

@FathiahHusna
Copy link

FathiahHusna commented Jul 14, 2019

I used to have the same issue. then i uninstall. and reinstall by referring this link. and it works!!
[Change Theme for Jupyter Notebook Python. Easy steps]https://www.youtube.com/watch?v=gjxrDf6Pp6M(url)

@sid3r
Copy link

sid3r commented Dec 2, 2019

jupyter-theme -t oceans16

Worked for me, thanx.

@codtiger
Copy link

I don't if anyone else has this problem, but after setting the $PYTHONPATH, I installed the package and the command still wasn't part of the binaries. Then I updated the package using sudo pip3 install --upgrade jupyterthemes and now the command is found!

@gbaldi96
Copy link

Good to hear @unnir , glad it worked.

Just to clarify for anyone who runs into this issue in the future. If you get an error saying that jt has not been installed correctly when trying to install a theme, first check to make sure the prioritized version of python on your system is included in your $PYTHONPATH.

In a terminal

# points to custom python install
$ echo $PYTHONPATH
# path to current prioritized python version
$ which python

If echo $PYTHONPATH doesn't return anything, open up your shell profile and update your $PYTHONPATH to include the one returned by which python.

In your .bashrc (or equivalent)

#ex. if which python returned /home/jingyang/anaconda3/bin/python
export PYTHONPATH="/home/jingyang/anaconda3/bin/python"

Save, open a new terminal session, and retry theme install.

what...

@gbaldi96
Copy link

I have no clue what this means

@FiReTiTi
Copy link

I work on MacOSX 10.15 and python 3.6, and it does not work.

I configure $PYTHONPATH, reinstalled jupyter-themes with sudo and pip, tried jt,jupytertheme , jupyterthemes, jupyter-theme, etc., I still get the error:

NameError: name 'jt' is not defined

Anymore things/tricks I could try?

@gbaldi96 : do you know how to use a terminal?

@ArjitJ
Copy link

ArjitJ commented Apr 10, 2020

I had the same issue on Windows 10. This is what worked for me.
Find the directory for storing site-packages using python -m site.
The parent directory of site-packages contains a directory (Scripts in Windows) which needs to be added to PATH.

@miaozj
Copy link

miaozj commented Apr 10, 2020

@RootofalleviI
I also meet the problem.
I think you can use find / -name "jt" to find where is jt
I find my jt is in ~/.local/lib/python3.5/site-packages/bin while my python is in /usr/local/bin
Then I

cd ~/.local/lib/python3.5/site-packages/bin  

python jt -l  

python jt -t oceans16

@dannaf

When I try to run jt and jt -l it works, but on jt -t oceans16 it complains about permission. Then when I run sudo jt -t oceans16 this is when the sudo: jt: command not found (running bash), and which reports which: no jt in (/sbin:/bin:/usr/sbin:/usr/bin). At this point I did sudo /usr/local/bin/jt -t oceans16 and it seemed to work fine.

I used the method above as @RootofalleviI posted and "cd" the path where my jt is but it didn't work.
After that, I took the action as @dannaf mentioned:

sudo + "the path where 'jt' lies" + command line options

It worked! Ty

@FiReTiTi
Copy link

@miaozj thanks a lot, it works.

@calinke
Copy link

calinke commented Apr 11, 2020

I'm not at all framilier with using my terminal (Mac running Catalina 10.15.4). When i type:

$ echo $PYTHONPATH
$ which python
nothing seems to happen.

Can anyone spell it out for me step by step?
Thanks

@azihna
Copy link

azihna commented Jun 12, 2020

Using Ubuntu:
I had the same problem and exporting PYTHONPATH as recommended above didn't fix the issue.
I found that it was caused by this shebang at the start of the 'jt' script (located in ~/.local/bin/jt). It was always referring to the system Python and it was causing issues when I had miniconda activated on my terminal.
The issue was resolved by changing the shebang at the start to:
#! /usr/bin/env python

@Norhan1998
Copy link

Using Ubuntu:
I had the same problem and exporting PYTHONPATH as recommended above didn't fix the issue.
I found that it was caused by this shebang at the start of the 'jt' script (located in ~/.local/bin/jt). It was always referring to the system Python and it was causing issues when I had miniconda activated on my terminal.
The issue was resolved by changing the shebang at the start to:
#! /usr/bin/env python

What are the steps to do that? I'm just a little nervous that I might do something wrong.

@azihna
Copy link

azihna commented Oct 12, 2020

Using Ubuntu:
I had the same problem and exporting PYTHONPATH as recommended above didn't fix the issue.
I found that it was caused by this shebang at the start of the 'jt' script (located in ~/.local/bin/jt). It was always referring to the system Python and it was causing issues when I had miniconda activated on my terminal.
The issue was resolved by changing the shebang at the start to:
#! /usr/bin/env python

What are the steps to do that? I'm just a little nervous that I might do something wrong.

  • Find the file by following steps shown by @RootofalleviI above to find jt (mine was in ~/.local/bin/jt)
  • Open jt using a text editor e.g. vim
  • Change the first line (it will start by #!), to #! /usr/bin/env python

@Norhan1998
Copy link

Using Ubuntu:
I had the same problem and exporting PYTHONPATH as recommended above didn't fix the issue.
I found that it was caused by this shebang at the start of the 'jt' script (located in ~/.local/bin/jt). It was always referring to the system Python and it was causing issues when I had miniconda activated on my terminal.
The issue was resolved by changing the shebang at the start to:
#! /usr/bin/env python

What are the steps to do that? I'm just a little nervous that I might do something wrong.

  • Find the file by following steps shown by @RootofalleviI above to find jt (mine was in ~/.local/bin/jt)
  • Open jt using a text editor e.g. vim
  • Change the first line (it will start by #!), to #! /usr/bin/env python

Thanks for the help to find the path to jt. It was actually an executable command, not a directory, so when I got to where it was, I type ./jt -t chesterish and it worked! I'm using Ubuntu 14.04, not sure if that'll make a difference. Anyways, thanks to you all again.

@XstormLeigh
Copy link

I am on Win10, ran into this "jt -l" scenario. This is how it is done:
ps. I have Listary

  1. use listary find where your "jupyter-theme" is
  2. add that directory into your path
  3. add your python library combos into your path
  4. go to cmd prompt and try again your "jt -l" command, and boom!
  5. that's how it is done
    image

@misharoe
Copy link

I'm on windows 11.
What (finally) worked for me was typing !jt -l instead of jt -l

@MonikaRiehn
Copy link

MonikaRiehn commented Oct 27, 2022

I really loved that beautiful dark theme, but for printing I must be able to switch from dark to light quickly. Nothing of the above worked for me. The command jt could not be found, it cost me hours, tried nearly all possible solutions. The only thing that worked was to delete the custom folder from jupyter and switch to dark theme via chrome://flags.

@zsaramousavi
Copy link

I have Python 3.9.13 on windows 10 Enterorise, I have Jupyterthemes installed, I ran : echo $PYTHONPATH
AND i GOT: $PYTHONPATH
STILL jt is not recognized when I want to change the theme

@zsaramousavi
Copy link

FYI: I tried !jt as well, but did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests