Deitel book "Python for Programmers" page xxxv.
Command "jupyter labextension install @jupyter-widgets/jupyterlab-manager" fails with error "Jupyter command jupyter-labextension
not found."
Any idea what is wrong?
I have installed Anaconda3, python 3.10.10 and issued commands from Terminal, Anaconda command prompt (logged in as administrator)
(Apr-08-2023, 11:57 AM)ricardian Wrote: [ -> ]I have installed Anaconda3, python 3.10.10 and issued commands from Terminal, Anaconda command prompt (logged in as administrator)
You most also activate
(base)
environment,if use
Anaconda Prompt it will do it automatic.
Eg here i use Minicona and do i manuel.
G:\miniconda3
λ cd Scripts\
G:\miniconda3\Scripts
λ activate.bat
(base) G:\miniconda3\Scripts
λ cd ..
(base) G:\miniconda3
λ conda -V
conda 22.11.1
(base) G:\miniconda3
λ pip -V
pip 22.3.1 from G:\miniconda3\lib\site-packages\pip (python 3.9)
The important part here is that
(base)
environment is now activate.
I do not use
(base)
envriomty,but my own.
Also when install
jupyter-labextension
it need Node.js.
conda install -c conda-forge ipympl
conda install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
(Apr-08-2023, 01:00 PM)snippsat Wrote: [ -> ] (Apr-08-2023, 11:57 AM)ricardian Wrote: [ -> ]I have installed Anaconda3, python 3.10.10 and issued commands from Terminal, Anaconda command prompt (logged in as administrator)
You most also activate (base)
environment,if use Anaconda Prompt it will do it automatic.
Eg here i use Minicona and do i manuel.
G:\miniconda3
λ cd Scripts\
G:\miniconda3\Scripts
λ activate.bat
(base) G:\miniconda3\Scripts
λ cd ..
(base) G:\miniconda3
λ conda -V
conda 22.11.1
(base) G:\miniconda3
λ pip -V
pip 22.3.1 from G:\miniconda3\lib\site-packages\pip (python 3.9)
The important part here is that (base)
environment is now activate.
I do not use (base)
envriomty,but my own.
Also when install jupyter-labextension
it need Node.js.
conda install -c conda-forge ipympl
conda install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
Thank you for your reply. The shortcut for "Anaconda Prompt" on my machine includes the "activate.bat" command, in full it is:
%windir%\System32\cmd.exe "/K" C:\Users\ricar\anaconda3\Scripts\activate.bat C:\Users\ricar\anaconda3
and I have already issued the command "conda install nodejs"
Looking at this make sure you have at least
JupyterLab 3.0
Then can just do:
pip install ipywidgets
This was the old way for version 2 of JupyterLab
jupyter labextension install @jupyter-widgets/jupyterlab-manager
.
Quick test with my own environment.
# Node version
(tom_env) G:\div_code
λ node -v
v16.15.1
# jupyter lab version
(tom_env) G:\div_code
λ jupyter lab -V
3.3.4
# install
(tom_env) G:\div_code
λ pip install jupyterlab_widgets
Requirement already satisfied: jupyterlab_widgets in g:\miniconda3\envs\tom_env\lib\site-packages (1.0.2)
So if start Jupyter lab.
(tom_env) G:\div_code
λ jupyter lab
[I 2023-04-08 18:35:31.545 ServerApp] jupyterlab | extension was successfully linked.
.....
Then in Notebook can use widgets.
![[Image: STJaQM.png]](https://imagizer.imageshack.com/v2/xq70/924/STJaQM.png)
Thanks for your advice. I'm not sure whether or not I have fixed the problem!
First I ran "pip install ipywidgets" and got lots of "requirement already met" output.
Then, in desperation, I ran Anaconda Navigator, found Jupyterlab which had the "install" icon showing and clicked it. After installation I shut Anaconda Navigator and tried running "jupyter labextension install @jupyter-widgets/jupyterlab-manager" again, it didn't fail this time but there was no definite indication that it had succeeded.
Then, as instructed in Deitel's book, I ran "jupyter labextension install jupyter-matplotlib", it didn't fail but again no definite indication that it had succeeded. Here's the output:
(base) C:\Windows\system32>jupyter labextension install @jupyter-widgets/jupyterlab-manager
Building jupyterlab assets (production, minimized)
|
(base) C:\Windows\system32>jupyter labextension install jupyter-matplotlib
Building jupyterlab assets (production, minimized)
\
Answering my own item - I seem to have sorted this out as I ran a python script from page 11 of the book and it worked (but only after I installed seaborn)
(Apr-08-2023, 08:21 PM)ricardian Wrote: [ -> ]Answering my own item - I seem to have sorted this out as I ran a python script from page 11 of the book and it worked (but only after I installed seaborn)
Dear Ricardian,
Please am learning Python with Deitel also and encountering same challenge as you did. I will apreciate you guide me how you were able eto run the below line of command successfully:
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
See error here --->
Thread
(May-12-2023, 12:40 PM)olufaruqu Wrote: [ -> ]Please am learning Python with Deitel also and encountering same challenge as you did. I will apreciate you guide me how you were able eto run the below line of command successfully:
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
Those install only works if you have installed and
old JupyterLab 2
version.
If now do
pip install jupyterlab
it will now install version v3.6.3.
This is
Installation pip install ipywidgets
So you most check what version you use
jupyter lab --version
or
conda list
If jupyter lab is old 2.0,then need to follow
this.
Just install the newest should work fine for the code in book,or can get in trouble with versioning in more places if use old stuff.