Install Python

  1. Install dependencies

    yum install openssl* bzip2 expat zlib* sqlite* libffi* libssl* wget -y

  2. Download the source code

    Wget HTTP: / / https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz

  3. Compile the installation

    # decompressionThe tar xf Python - 3.7.4. TGZ# compiler
    cdPython - 3.7.4 &&. / configure -- prefix = / usr /local/python3 --with-ssl
    Add sqlite3 path
    vi setup.sh 
    ## add '/usr/bin/sqlite3' to sqlite_inc_path
    # compiler
    make -j20
    # installation
    make install
    Add system environment variables
    echo 'export PATH=${PATH}:/usr/local/python3/bin' >> /etc/profile
    source /etc/profile
    Test, enter interactive mode
    python3
    Copy the code

Install Juypter Notebook by pip

  1. Install Jupyter using PIP

    pip3 install jupyter

  2. View the location of the Jupyter configuration file

    jupyter notebook --generate-config

  3. Configuration Jupyter

    1. Example Create a Jupyter access password
    The command terminal opens Python interactive mode
      python3
    # import passwd
      from notebook.auth import passwd
    passwd()
      # Input password
      Export sha1 key, copy and paste it into configuration file
    Copy the code
    1. Example Change the password of Jupyter

      c.NotebookApp.password='passwd'

    2. Configuration Jupyter

      Create a certificate
      openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout jupyter.key -out jupyter.pem
      Modify the Jupyter configuration file
      c.NotebookApp.ip = '192.168.0.230'
      Configure the SSL encryption certificate
      c.NotebookApp.certfile = '/home/kim/jupyter-key/jupyter.pem'
      c.NotebookApp.keyfile = '/home/kim/jupyter-key/jupyter.key'
      # Start Jupyter without opening the browser
      c.NotebookApp.open_browser=False
      # Change the default port number
      c.NotebookApp.port = 9088
      Copy the code
  4. Enable the Jupyter port

    firewall-cmd --zone=public --add-port=9088/tcp --permanent && irewall-cmd --reload

  5. Start the Jupyter

    jupyter notebook

Install IPython

  1. Install IPython using PIP

    pip3 install ipython

  2. Install and register IPython in Jupyter

    # install ipykernel
    pip3 install ipykernel
    # Register with Jupyter
    python3 -m ipykernel install --user --name online_jupyter --display-name IPython-Online
    Copy the code
  3. Open your browser and create a file

    https://192.168.0.230:9088
    Enter the password for creationCreate a new ipython-online fileCopy the code

reference

  1. Setup Jupyter Notebook server – Centos/Rhel 7

  2. Interactive Parallel Computing with IPython

  3. Install IPython