In this article i will tell you how to create python virtual environment, how to start jupyter notebook web server and how to create jupyter notebook file in anaconda.
1. Create A Python Virtual Environment In Anaconda.
- Click Start —> Anaconda —> Anaconda Navigator menu item.
- In the opened anaconda navigator window, click Environments menu item in left side, then click Create button at right bottom to create a python virtual environment.
- If you want to create or manage anaconda virtual python environment with command line, you can read article How To Manage Anaconda Environments.
2. Start Jupyter Notebook In Above Python Virtual Environment.
- Click the green triangle button at the end of the python virtual environment, then click Open Terminal menu item in the popup menu list.
- Then it will popup a command line console window. Go to the folder where you want to save your jupyter notebook files and python script files use cd command like below.
(env_jupyter_example) C:\Users\song zhao>cd C:\WorkSpace\JupyterExampleProject\JupyterSlideBarExample
- Then run command jupyter notebook to start jupyter notebook web server. Then all the jupyter notebook files and folders will be saved in this folder.
(env_jupyter_example) C:\WorkSpace\JupyterExampleProject\JupyterSlideBarExample>jupyter notebook [I 09:50:36.790 NotebookApp] JupyterLab extension loaded from C:\Anaconda\lib\site-packages\jupyterlab [I 09:50:36.791 NotebookApp] JupyterLab application directory is C:\Anaconda\share\jupyter\lab [I 09:50:36.865 NotebookApp] Serving notebooks from local directory: C:\WorkSpace\JupyterExampleProject\JupyterSlideBarExample [I 09:50:36.865 NotebookApp] The Jupyter Notebook is running at: [I 09:50:36.867 NotebookApp] http://localhost:8888/?token=7b4366a32146528811158f6400bec3f8afee5d8f7c1eb157 [I 09:50:36.867 NotebookApp] or http://127.0.0.1:8888/?token=7b4366a32146528811158f6400bec3f8afee5d8f7c1eb157 [I 09:50:36.867 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 09:50:37.032 NotebookApp] To access the notebook, open this file in a browser: file:///C:/Users/song%20zhao/AppData/Roaming/jupyter/runtime/nbserver-2924-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=7b4366a32146528811158f6400bec3f8afee5d8f7c1eb157 or http://127.0.0.1:8888/?token=7b4366a32146528811158f6400bec3f8afee5d8f7c1eb157
- When above process complete, it will open a web browser and list all the files exist in current folder ( in this example is C:\WorkSpace\JupyterExampleProject\JupyterSlideBarExample> ).
3. Create Jupyter Notebook Python File, Text File, Folder And Terminal.
- Click the New button at right side of the files list page, then it will popup menu list like below. There are 4 menu items in the list, you can create Python 3 notebook file, Text File, Folder and Terminal.
- Click New —> Python 3 menu item to create a jupyter notebook file. Then it will open a new web browser tab and you can write ipython command in the jupyter notebook file.
- If you want to run python 2 code in jupyter notebook, please read article How To Run Python 2 Code In Jupyter Notebook
- Click New —> Text File menu item to create a new text file.
- Click New —> Folder menu item to create a new folder. The default folder name is Untitled Folder.
- Click New —> Terminal menu item to open a terminal in a new web browser tab. In this terminal, you can run ls, pwd command no matter which OS ( Windows, Linux, MacOS etc ) you are using.
4. Edit ( Rename, Move, Download, Delete etc ) Jupyter Notebook File, Folder.
- If you want to rename jupyter notebook file when edit it, just double click the file name ( Untitled ) at top left corner of the page, then it will popup a dialog to let you rename it.
- You can also manage the jupyter notebook file or folder in the list page by check the checkbox before the file or folder name, then click Rename, Move, Download, Delete button at top area of the list.
- But if a jupyter notebook file is running ( such as you are editing it ) when you check it, it will show a brown color Shutdown button, you should first click this button to shutdown it first, then you can manage it.
- How To Use IPython Jupyter Notebook To Develop Python Code
- How To Manage Anaconda Environments
- How To Run Python 2 Code In Jupyter Notebook