Cannot get to command prompt mode in Jupyter Notebook

I understand that I have to type in the command “pip install PyPdf2” at the command prompt window from within Jupyter Notebook instead of from the Windows command prompt window. In Jupyter Notepad none of the recommended methods for changing to command mode have any effect - i.e. click outside the cell, press , press How can I get to the command prompt window from within Jupyter Notepad?

I’m not quite following what you mean by Jupyter Notepad. However, you don’t want to be in command mode to install a package from within a Jupyter notebook because you cannot type in cells in command mode:

“When you are in command mode, you are able to edit the notebook as a whole, but not type into individual cells” - SOURCE

You want to be able to type in a notebook cell to install packages from inside a Jupyter notebook.
To install your example package from within a Jupyter notebook, you want to type the following in a normal cell still in normal editing mode:

%pip install PyPDF2

That uses the pip magic command that insures the installation occurs in the environment that is backing the kernel underlying the notebook.

For additional related information, you generally don’t need any symbol to run that command in a modern notebook because usually automagics is on by default. And by not including a symbol, the magics command gets used behind-the-scenes. What you don’t want to use in front of pip or conda is an exclamation point. Anything suggesting that is outdated and not aware of the modern magic commands for pip and conda.

Your simple suggestion solved my problem.

My browsing of the Internet found that this is a commonly reported problem and some of the suggested fixes were extremely complex. Thank you ever so much for giving me a simple effective solution to my show-stopping problem Wayne.

1 Like

Did you also post a similar questions as “Raymond Morris” on StackOverflow here?

It is always best to indicate when you cross-post at each location so that other people can look and see what has been suggested among the various sites. Also, if it is resolved, then everyone following in the footsteps has the solution among the posts. For example, future you may have that question six months from now, remember you had asked that question in the past, and then find that currently unresolved Stackoverflow question, forgetting you found the answer on the Jupyter Discourse Forum.

1 Like

I don’'t remember what I did. I was in a panic.