Home > Software engineering >  Unable to install PIP & PYMSSQL in docker
Unable to install PIP & PYMSSQL in docker

Time:09-17

I am trying to build a docker image with

  1. Python
  2. PIP
  3. pymssql

below is my Dockerfile

FROM ubuntu:latest
RUN apt-get update -y
RUN apt-get update && apt-get install -y telnet && apt-get install -y ksh && apt-get install -y python2.7.x && apt-get update && apt-get install -y python-pip python-dev build-essential && apt-get -y clean && rm -rf /var/lib/apt/lists/*
RUN pip install pymssql==2.1.3
ENTRYPOINT ['python']

it is throwing the following error:

enter image description here

CodePudding user response:

Python-pip is only available on Ubuntu Bionic. see python-pip.

You need to switch from focal to bionic. Universe repository should be enabled.

CodePudding user response:

If you don't mind to use python3 (otherwise use virtual env) I rate you to do :

RUN apt-get install python3-pip

Then you will be able to install whatever pip package you need : by doing :

RUN pip3 install <your_pip_pkg>
  • Related