For Windows users: the difference between the command prompt, the miniforge prompt, and the Python interpreter#
Many of you have opened a prompt (a terminal) for the first time in this class. There is nothing to be afraid of. You will use the prompt very often, but you won’t need it for anything else than starting python, jupyterlab, or any other python tool of your choice.
The command prompt (or cmd.exe
)#
You will find it by typing cmd
in the windows search bar:
In the command prompt, you can do many things, but the one thing you will really need is to navigate to the folder of your choice. The name of the currently active folder is always indicated at the start of the command line.
Only a few commands are necessary for this class:
help
: seeing the list of commands availabledir
: list the directories (folders) in the current locationcd FolderName
: navigate to the folder FolderNamecd ..
: navigate one folder upTAB
: ask the command prompt to complete the name for you. For example, if you are lazy and type two letters of the desired folder only, typingTAB
might complete it for youexit
: exit the prompt (you can also simply close the window)
That’s it! The reason why you need to be able to navigate to a specific folder will be explained in the next lesson.
The miniforge prompt#
You will find it by typing “miniforge” in the windows search bar:
You will recognize that you are in a miniforge prompt by the title of the window and the (base)
text before the location:
The miniforge prompt is exactly like the command prompt, BUT it has python installed in it. All the commands explained above work in the miniforge prompt as well, but these new commands are now available to you:
all the
mamba
commands (mamba list
,mamba install
, …)opening a python interpreter (
python
, and later today alsoipython
,jupyter-lab
)
In practice, you will actually never open the command prompt, but always the miniforge prompt. You will use it to navigate to a folder and then start a python interpreter.
The python interpreter#
The python interpreter can be opened in many different ways, but the way you learn first is to start it from the miniforge prompt. The python interpreter is recognizable by the three “greater than” signs at the beginning of the command line >>>
. The python interpreter is where the python commands are valid.
Be aware of the context
Be aware of the interpreter your are using. To summarize:
In the command prompt, you can navigate between folders (
cd
,dir
, etc.)In the miniforge prompt, you can navigate between folders AND you can install python packages (
mamba
) and start python (python
orjupyter-lab
)In the python interpreter, you can type python commands and much much more