
Using Your Operating System Without Leaving Jupyter
Using Your Operating System Without Leaving Jupyter 관련


JupyterLab allows you to directly access your operating system’s command-line environment. To do this, you click the Terminal button as shown:

In Windows, this opens PowerShell. In Linux, it’s usually a Bash shell, while macOS usually uses a Zshell. Once you have a command line, you can then enter the operating system commands that you need. Just remember that you’re running the commands with the same privileges as those that you’ve used to access JupyterLab, so unless you run with administrator privileges, you won’t be able to run all commands.
The screenshot below shows a Windows PowerShell terminal that you’ve accessed from within JupyterLab:

Here you’ve inspected the contents of the Samples
folder using the tree
command. As you can see, there are nine files plus one subfolder containing checkpoint information about some of your files. This folder is actually hidden, and you don’t need to worry about its content.
The terminal is useful if you need to use the command line to install a module.
Note
When you start a terminal, it runs within the same Python environment where JupyterLab is running. So if you’re running JupyterLab in a virtual environment, then all the packages that you install with this terminal will install into your virtual environment. This means that they’ll be available to your notebooks, consoles, and other terminals, but they won’t interfere with any Python installations outside of the virtual environment.
You can also use the terminal to run additional Python code and keep it separate from the code that you’re running elsewhere in JupyterLab. Each time you open a terminal, it gets its own kernel, meaning you can have multiple terminals and commands running without interfering with each other.