Jupyter lab is showing 'jupyter-lab' not found in Anaconda prompt - jupyter-notebook

I am using anaconda and from the base environment of it, I can easily open jupyter notebook and jupyter lab. I have another environment named gpu_jupyter which was also running fine. But after installing nltk on base enviroment (using conda install), jupyter lab is not working on gpu_jupyter env. It is showing
Traceback (most recent call last):
File "C:\Users\emt\anaconda3\envs\gpu_jupyter\Scripts\jupyter-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\emt\anaconda3\envs\gpu_jupyter\lib\site-packages\jupyter_core\command.py", line 285, in main
command = _jupyter_abspath(subcommand)
File "C:\Users\emt\anaconda3\envs\gpu_jupyter\lib\site-packages\jupyter_core\command.py", line 124, in _jupyter_abspath
raise Exception(
Exception: Jupyter command `jupyter-lab` not found.
I tried with installing the nb_conda. The ipykernel is also installed and jupyter notebook is also working fine. Jupyter lab is also can be run using the base env
I also tried to add path but somehow my Continumm folder is missing. This link discuss that problem but the solution for that folder is not given.
Is there anything that I am missing here?

installing using pip solved my issue. My env is created via miniconda.
pip install jupyterlab
Then run it via miniconda command prompt by
jupyter lab

Related

Cannot start jupyter notebook after deleting anaconda

What happened:
I have had Pip and Anaconda installed on my Mac. I tried to tidy up and decided to delete Anaconda since I assumed I only needed Pip for my Python programming.
My question:
I have been using jupyter notebook for my university project. Apparently, it had been installed by me using anaconda. Now that anaconda is gone, when I try running jupyter notebook, it is still looking in the deleted anaconda directory and throws the following error in the command line
/Users/username/anaconda3/bin/jupyter: No such file or directory
Furthermore, I now get this error when installing jupyter using pip3:
WARNING: The scripts jupyter, jupyter-migrate and jupyter-troubleshoot are installed in '/Users/username/Library/Python/3.8/bin' which is not on PATH.
Unfortunately, I barely have an idea of what I am doing when installing anything using the command line. Could you help me out in fixing the issue?

Installing R 4.0.2 version

I used to work in R 3.4.0 version. Hovewer, this version doesn't support such packages as keras and tensorflow.
I was adviced to upgrade my R version to the newest one.
I downloaded the most recent R version 4.0.2 from the official site, then ran the following code:
install.packages("keras")
library(keras)
install_keras()
And got the following error:
Error in install_keras() :
You should call install_keras() only in a fresh R session that has not yet initialized Keras and TensorFlow (this is to avoid DLL in use errors during installation)
After this, when I tried to quit R session by q() , I faced the following error:
Error: option error has NULL value
Error: no more error handlers available (recursive errors?); invoking 'abort' restart
Error: option error has NULL value
I've never faced such an error before. When I used old R version, I typed q() and then had to choose between y and n. No errors appeared.
I'm asking you to help to to solve this problem.
You need to create a new environment and then you can install R 4.+ in Anaconda. Follow these steps.
conda create --name r4-base
After activating r4-base run these commands
conda activate r4-base
conda install -c conda-forge r-base
conda install -c conda-forge/label/gcc7 r-base
Finally, you will notice r-basa version 4 will be installed.
Thereafter, you can install any supported packages. But with this only, you won't have the ability to use it in the Jupyter notebook. You need to install install.packages('IRkernel') and Jupyter notebook as well if you want to use it. Otherwise you are good to go with R-Studio.
For Jupyter Installation and RKernel.
conda install jupyter
Then open the R console. Write in R console
install.packages('IRkernel')
IRkernel::installspec()
Congrats! You can use Notebook for Python and R.
Find the location of R.exe on your computer. In my computer, this executable is at
C:\Program Files\R\R-3.4.3\bin
Open another Anaconda Prompt as Administrator and change directories to wherever R.exe is on your computer with cd file path. On my computer, it’s cd C:\Program Files\R\R-3.4.3\bin, but it might be different for you.
Then run R from within Anaconda Prompt in Admin mode with R.exe
You’ll notice that you’re in an R session. From here, run the following three commands into the terminal.
install.packages("devtools")
devtools::install_github("IRkernel/IRkernel")
IRkernel::installspec()
In order, they (1) install the devtools package which gets you the install_github() function, (2) install the IR Kernel from GitHub, and (3) tell Jupyter where to find the IR Kernel.
Open Jupyter notebook and enjoy your new R kernel!
Get more information here
#Rheatey Bash works perfectly. but i was facing python.exe this program cant start because api-ms-win-core-path-l1-1-0.dll python system error. this is a problem running on windows 7 but i resolved this issue by installing the kernel following https://richpauloo.github.io/2018-05-16-Installing-the-R-kernel-in-Jupyter-Lab/ and it works fine

Error when trying to run jupyter notebook: Import error: no module named jupyter_core.command

I am running Ubuntu Linux on my laptop, Anaconda 3 with python version 3.6. Jupyter notebook worked fine for me the last time I used it on this computer, but that was 3 months ago. So today I turn it on and try to run jupyter notebook, and I get this error:
john#john-Satellite-L55Dt-B:~$ jupyter notebook
Traceback (most recent call last):
File "/home/john/anaconda3/bin/jupyter", line 7, in <module>
from jupyter_core.command import main
ImportError: No module named jupyter_core.command
I'll admit I'm completely lost and a little rusty with my LINUX, so what do I need to do to make it work?
Try to export the below path and take jupyter noteboo again.Hope this helps.
export PATH= /home/john/anaconda3/bin:$PATH
You can create a conda environment using the below command:
conda create -n env_sample -c intel python=3.6
To activate the environment use the below command:
source activate env_sample
env_sample is the environment name

"module not found" in jupyter lab, but works fine in "jupyter notebook"

I use conda python environment. I start the Jupyter lab following the steps below:
$conda activate <env_name>
$jupyter lab --no-browser --port=8080 &
Now, from a jupyter lab notebook, when I try to import feather (import feather), it fails with Module Not Found message.
From the jupyter lab notebook, if I execute the following, it shows me that feather is present:
! conda list | grep feather
Now, if I shutdown Jupyter Lab in the same VM and start Jupyter Notebook instead, feather gets imported successfully from the notebook.
$conda activate <env_name>
$jupyter-notebook --no-browser --port=8080 &
I see this discussion, but don't see a solution there.
Alternatively, check your path from within your Jupyter notebook vs on the command line. I found that appending the module paths to sys.path solved this exact issue.
All of the ~/anaconda3/envs/[env]/lib/python3.7* paths were missing in my case.
I have found a possible work around to avoid this issue. This is based on this answer.
From the conda environment (e.g. my_env), I can create a new Python 3 kernel (say, python3_custom). Now, this kernel will be associated with all the libraries installed in that conda environment.
$ conda activate my_env
(my_env)$ conda install ipykernel
(my_env)$ ipython kernel install --user --name=python3_custom
(my_env)$ conda deactivate
I come out of my_env or base environment. Then I start JupyterLab from the command prompt:
jupyter lab --no-browser --port=8080 &
Once I open my notebook now, I can select the kernel as python3_custom. Since in the associated conda environment (my_env), feather is already installed, I don't get the error "Module Not Found" any more.

Cannot get IRkernel::installspec() to work, jupyter-client not visible

I am still in progress to get Jupyter-Notebook and R working together on Windows 10 machine. After solving the problem with install_github() I am now facing just another issue. I am still following the official installation guide, I am stuck at step 2:
Every time I get this error - I have tried this in R GUI and RStudio, the same:
> IRkernel::installspec()
Error in IRkernel::installspec() :
jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 127.
In addition: Warning message:
In system2("jupyter", c("kernelspec", "--version"), FALSE, FALSE) :
'"jupyter"' not found
My attempts so far: It was suggested here and here, that this could be a problem with the PATH variable setting, so I have added Anaconda to the PATH enviroment. I also installed the jupyter-client via the Anaconda console. No change so far. Any ideas?
This answer is based on this by #Ryan, but since the question answered was actually about a Linux based system I put it here in a Windows question:
One way to overcome the problem - if adding PATH variables to the environment doesn't work - is the following:
If Anaconda is installed and the Jupyter-Notebook with it (should be the standard install), open up the Anaconda prompt, not the Windows command prompt or the Anaconda Navigator
Look up the executable of R (not Rgui or Rstudio), it should be somewhere like C:\Program Files\R\R-3.5.1\bin and copy the path
Paste the path into the Anaconda prompt and start R by typing R
Now execute IRkernel::installspec() once again, this time there shouldn't be an error
Now you can start an R kernel within Jupyter-Notebook
You should try to open R in the terminal, if you changed directory where R il located type:
R.exe
and then run:
IRkernel::installspec()
I was having this issue trying to run Jupyter Lab on my Ubuntu 18.04 LTS headless server running in an Azure VM.
To resolve the issued, I had to navigate to /usr/bin and open R from there. It turns out that despite my path, calling R from the terminal opened the anaconda3 version in /home/<you>/anaconda3/bin/R.
Run IRkernel::installspec() from /usr/bin/R in as sudo and it should add the kernel.
If jupyter.exe is installed under c:\python36\sripts, run
"setwd("c:/python36/scripts")" on R GUI, run "IRkernel::installspec()"
Simply create a new virtual environment for R. Either using the CLI or the anaconda Navigator (best recommended, If and if you're using Anaconda).

Resources