python3 install ipython notebook using pip

python 3.6 , because I don't want to install anaconda, but the ipyhon notebook keeps making mistakes, so I will commemorate it after I do it.

  1. Enter pip install ipython[all] on the command line to install ipython
  2. Enter ipython notebook on the command line, and find that it cannot be run, and an error is reported: ModuleNotFoundError: No module named 'markupsafe._compat'
  3.  Check the installed packages through pip list, and found that markupsafe has been installed, but in the python environment import markupsafe._compat found that there is no such module, it feels like the installation of this module was unsuccessful, so reinstall the package. First uninstall this package via pip uninstall markupsafe. Then pip list , confirm to uninstall this module.
  4. Reinstall the markupsafe module: Do not install directly with pip install markupsafe, because an error will be found: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6. But at this time, you will find that markupsafe has been installed in pip list, so first pip uninstall markupsafe, make sure, make sure, make sure this package is uninstalled. Open the python location: {Python installation directory}\Lib\site-packages\pip\compat, open __init__.py with a text editor (such as Notepad), return s.decode('utf_8') on line 75, put Replace this line with return s.decode('cp936'). This is a common error encountered when installing modules with pip. After making changes, save and exit. Then pip install markupsafe can install the package normally.
  5. After installing this package normally, and then ipython notebook, I found that it can be opened.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690362&siteId=291194637