How to install pyzmq on a Alpine Linux container?

前端 未结 3 2084
鱼传尺愫
鱼传尺愫 2021-02-10 03:49

I have a container with python:3.6-alpine kernel, I have a problem to install the pyzmq with pip on this:

Dockerfile:

3条回答
  •  梦毁少年i
    2021-02-10 03:56

    Thanks @hoefling, I fixed this dependency problem with install py3-pyzmq package first on Alpine Linux v3.12.

    1. Run the docker container of Alpine 3.12.

      [ chusiang@macOS-11.0.1 ~ ]
      $ docker run -it --rm alpine:3 sh
      
    2. Install the apk package of py3-pyzmq.

      /home # apk add py3-pyzmq
      (1/3) Installing libsodium (1.0.18-r0)
      (2/3) Installing libzmq (4.3.3-r0)
      (3/3) Installing py3-pyzmq (18.1.1-r0)
      OK: 385 MiB in 97 packages
      
    3. Install pip3 package of jupyter notebook.

      /home # pip3 install jupyter
      
    4. DONE !

      /home #  jupyter --version
      jupyter core     : 4.7.0
      jupyter-notebook : 6.1.5
      qtconsole        : 5.0.1
      ipython          : 7.19.0
      ipykernel        : 5.4.1
      jupyter client   : 6.1.7
      jupyter lab      : not installed
      nbconvert        : 6.0.7
      ipywidgets       : 7.5.1
      nbformat         : 5.0.8
      traitlets        : 5.0.5
      

    By the way, I reference this post to upgrade the Python 2 -> 3 on my docker image project of "ansible-jupyter".

    https://github.com/chusiang/ansible-jupyter.dockerfile/commit/200c9a48232b0149adb85fa9e5fc025730691599

提交回复
热议问题