Python Forum
Deitel book "Python for Programmers"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deitel book "Python for Programmers"
#1
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)
Reply
#2
(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
Reply
#3
(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"
Reply
#4
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]
Reply
#5
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)
\
Reply
#6
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)
Reply
#7
(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
Reply
#8
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner stuck in Python book for kids mic81k 11 1,214 Nov-27-2023, 04:28 AM
Last Post: deanhystad
  best " Learning Python " book for a beginner alok 4 3,065 Jul-30-2021, 11:37 AM
Last Post: metulburr
  Nested Python functions (Dan Bader's book) Drone4four 4 2,585 Jun-26-2021, 07:54 AM
Last Post: ndc85430
  I really need help, I am new to python, I am using a book that helps me to learn JaprO 5 2,998 Nov-28-2020, 02:30 PM
Last Post: JaprO
  creating an 'adress book' in python using dictionaries? apollo 6 14,837 May-06-2019, 12:03 PM
Last Post: snippsat
  3 easy questions for python programmers but 3 pain in the ass for me grjmmr 6 3,988 Jul-22-2018, 08:41 PM
Last Post: Larz60+
  IndentationError message could be confusing to new programmers insearchofanswers87 1 2,353 May-16-2018, 05:05 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020