Tag Archives: notebook

ModuleNotFoundError: No module named ‘notebook‘

ModuleNotFoundError: No module named ‘notebook’

Problem modulenotfounderror: no module named ‘notebook’

This problem occurred when running notebook today. Now I’d like to share with you how to solve this problem

terms of settlement

    open the terminal: Win + R, enter “CMD”, then “enter”
    activate the environment when you run the code: “CONDA activate + your environment name”
    after entering your environment, enter “Python – M PIP install Jupiter”, and then “enter”
    appears at the bottom to indicate that the installation is successful
    then enter: IPython notebook
    . This page indicates that the problem has been solved

Change Jupyter Notebook Default Directory

Change Jupyter Notebook Default Directory

There are three way to change the default (i.e., start-up) directory of jupyter notebook.

Solution #1
1. Use command line (aka, cmd), run the following command: this will generate a config file (jupyter_notebook_config.py), in your working location (C:\Users[Your Username].jupyter).
jupyter notebook --generate-config
2. Goto that location (C:\Users[Your Username].jupyter) and edit file jupyter_notebook_config.py as follow.
Find line:

## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''

3. Delete the “#” and type your default directory inside the ”. (Make sure the directory is exist, or it may causes some troubles)
For example:

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'E:\Default Jupyter Dir\'

Solution #2
1. Find the Jupyter Notebook execute file.
2. Right click the file
3. Find “properties” tab and click it; this will lead you to the “Jupyter Notebook Properties”
4. Check the pop-up window, and you should see “Start in” property.
5. Change the directory to your default directory, e.g., ‘E:\Default Jupyter Dir\’
Solution #3

This solution is based on Anaconda, since Jupyter Notebook load the profile from Anaconda.

You may see the following information from properties window if you had gone through Solution #2.

"Target: D:\Anaconda3\python.exe d:\Anaconda3\cwp.py d:\Anaconda3 "d:/Anaconda3/python.exe" "d:/Anaconda3/Scripts/jupyter-notebook-script.py" %USERPROFILE%"

1. Goto the Anaconda installed location.
2. Find the ‘etc’ directory in Anaconda.
3. Open file ‘jupyter_notebook_config.json’
4. Add your default directory to the ‘notebook_dir’.

How to Fix Pandoc wasn’t found.pdflatex not found on PATH

Nbconvert failed: Pandoc Wasn’t found resolved. Nbconvert Failed: PDFlatex Not Found on PATH resolved
Problem 1 Description
500: Internal Server Error
nbconvert failed: Pandoc wasn’t found.
Please check that Pandoc is installed:

Problem 2 Description
500 : Internal Server Error
nbconvert failed: pdflatex not found on PATH
http://pandoc.org/installing.html

Solutions:
1. Install pandoc
Download pandoc official download http://pandoc.org/installing.html
Other available CSDN resources download address
click to install directly, the default installation is ok, you can choose the installation location.
then configure the environment variable to configure the installation path to the system path. For example, I put E:\IDE\Pandoc into the PATH.
2. Install miktex
Click installation directly, the default installation can be selected, and the installation location can be selected.
(if the program does not automatically configure environment variables) requires manual configuration of environment variables to configure the installation path to the system path. If mine is put E:\IDE\MiKTeX 2.9\ MiKTeX \bin\x64 in path.

3. Install various macro packages
Select Convert PDF

Automatic prompt to install various macro packages can be directly click to install (install several times, until the installation is complete…)


Can choose to remove the check box, each installation does not need popup, automatic installation, will be much faster, also save trouble.

Completed, you can successfully convert English content, including images, code highlights, and so on.

Attention! , but if it contains Chinese content, it will report an error, and the Chinese cannot be converted.
To solve the problem of unable to convert the Chinese method, others did not test the time of the follow-up Chinese support problems, personally solved after updating the content of the blog.

Error converting jupyter notebook to PDF

nbconvert failed: PDF creating failed, captured latex output:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
< > .\notebook
.tex
?
! Emergency stop.
< > .\notebook
.tex
No pages of output.
Transcript written on ?.

solution:
1, if the file path with Chinese, remove the Chinese
2, find the installation path under the PDF. Py file open
… \site-packages\nbconvert\exporters\pdf.py

#writer = Instance("nbconvert.writers.FilesWriter", args=(), kw={'build_directory': '.'})
writer = Instance("nbconvert.writers.FilesWriter", args=(), kw={'build_directory': ''})

The

and 'build_directory' : '. ' to ' build_directory ':'

GitHub