What I want to do is to create a shortcut for Jupyter Notebook which has to run in WSL (because all my python packages are there). For this AFAIK I should create PowerShell script which runs WSL with command to launch Jupyter Notebook, something like this:
wsl -e bash -c "jupyter notebook"
But this command gives bash: jupyter: command not found although if I do it step by step, it launches Jupyter:
PS C:\Users\Artem> wsl
(base) artem@LAPTOP-O4C3S1UK:/mnt/c/Users/Artem$ jupyter notebook
All tested commands suffer from one of these problems:
jupyter or anaconda)I am not proficient enough in PowerShell/WSL scripting so asking for advice how to do it properly.
P.S. I guess I can install jupyter for Windows and add kernels from WSL, but I want to know if problem can be solved in the way described above.
It sounds like required initializations are performed in your ~/.bashrc file, which bash by default only loads in interactive sessions, not when you submit a command to execute with -c.
However, you can explicitly tell bash to consider a session interactive, using the -i option.
Therefore, try the following (note the -i):
wsl -e bash -ic "jupyter notebook"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With