I want to use jupyter notbook by using Anaconda3 in docker ubuntu, but when I create an image with docker build --platform linux/amd64 . the following error occurs.
How can I solve it?
#8 141.1
#8 141.1 2022-05-05 04:21:55 (3.62 MB/s) - 'Anaconda3-2019.10-Linux-x86_64.sh' saved [530308481/530308481]
#8 141.1
#8 141.3 PREFIX=/opt/anaconda3
#8 143.4 Unpacking payload ...
[96] Failed to execute script entry_point concurrent.futures.process._RemoteTraceback:
#8 151.7 '''
#8 151.7 Traceback (most recent call last):
#8 151.7 File "concurrent/futures/process.py", line 367, in _queue_management_worker
#8 151.7 File "multiprocessing/connection.py", line 251, in recv
#8 151.7 TypeError: __init__() missing 1 required positional argument: 'msg'
#8 151.7 '''
#8 151.7
#8 151.7 The above exception was the direct cause of the following exception:
#8 151.7
#8 151.7 Traceback (most recent call last):
#8 151.7 File "entry_point.py", line 71, in <module>
#8 151.7 File "concurrent/futures/process.py", line 483, in _chain_from_iterable_of_lists
#8 151.7 File "concurrent/futures/_base.py", line 598, in result_iterator
#8 151.7 File "concurrent/futures/_base.py", line 435, in result
#8 151.7 File "concurrent/futures/_base.py", line 384, in __get_result
#8 151.7 concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
------ executor failed running [/bin/sh -c wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && sh /opt/Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3 && rm -f Anaconda3-2019.10-Linux-x86_64.sh]: exit code: 1
The Dockerfile is like below:
FROM ubuntu:latest
# update
RUN apt-get -y update && apt-get install -y \
sudo \
wget \
vim
#install anaconda3
WORKDIR /opt
# download anaconda package and install anaconda
# archive -> https://repo.continuum.io/archive/
RUN wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && \
sh /opt/Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3 && \
rm -f Anaconda3-2019.10-Linux-x86_64.sh
# set path
ENV PATH /opt/anaconda3/bin:$PATH
# update pip and conda
RUN pip install --upgrade pip
WORKDIR /
RUN mkdir /work
# execute jupyterlab as a default command
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--LabApp.token=''"]
Mac 12.3.1 Apple M1
Docker desktop for Mac 4.7.1
It can be a space issue during the installation, I was getting the exact error. If you accept the default option to install Anaconda on the “default path” Anaconda is installed in your user home directory, where space can be an issue. For me it got resolved when changed the default directory to some other directory during installation .You can also refer this page for similar issues- https://github.com/conda/conda/issues/10143
Related
In my application, I need to build a docker image on a k8s init-container using docker-in-docker approach.
This is the Dockerfile of the init container:
FROM docker-hub-mirror.mycorp.com/docker:dind
ARG username
ARG password
RUN apk update && apk add --no-cache bash curl git git-lfs ca-certificates coreutils
RUN git-lfs install
COPY daemon.json /etc/docker/daemon.json
COPY scripts/* /bin/
RUN docker login harbor.mycorp.com -u=${username} -p=${password};\
sed -i "s/ROBOT_USER/${username}:${password}/g" /bin/build_image.sh
ENV SHOWROOM_LOG_PATH=/var/log/showroom/app.log
ENTRYPOINT ["dockerd-entrypoint.sh"]
The flow is to build the input docker image first and use that image to run the application in application containers later.
This is the input Dockerfile:
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /content
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y sudo && apt-get install -y python3-pip && pip3 install --upgrade pip
RUN apt-get install -y curl gnupg wget htop sudo git git-lfs software-properties-common build-essential libgl1 zip unzip
RUN add-apt-repository ppa:flexiondotorg/nvtop
RUN apt-get upgrade -y
RUN apt-get install -y nvtop
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN npm install
RUN npm install -g configurable-http-proxy
ENV PATH="/home/admin/.local/bin:${PATH}"
RUN pip3 install jupyterhub && \
pip3 install --upgrade notebook && \
pip3 install oauthenticator && \
pip3 install pandas scipy matplotlib && \
pip3 install --upgrade jupyterlab jupyterlab-git && \
pip3 install ipywidgets && \
pip3 install torch torchvision torchaudio && \
jupyter lab build
RUN jupyter nbextension enable --py widgetsnbextension
RUN git clone https://github.com/camenduru/jupyter
COPY login.html /usr/local/lib/python3.10/dist-packages/jupyter_server/templates/login.html
RUN adduser --disabled-password --gecos '' admin
RUN adduser admin sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN chown -R admin:admin /content
RUN chmod -R 777 /content
RUN chown -R admin:admin /home
RUN chmod -R 777 /home
USER admin
EXPOSE 7860
CMD jupyter-lab --ip 0.0.0.0 --port 7860 --no-browser --allow-root --NotebookApp.token='huggingface' --NotebookApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" --NotebookApp.cookie_options="{'SameSite': 'None', 'Secure': True}" --NotebookApp.disable_check_xsrf=True
It failed at this line
RUN add-apt-repository ppa:flexiondotorg/nvtop
At first, I got this error from the init-container logs
#0 2.170 File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 230, in __init__
#0 2.170 super(Launchpad, self).__init__(
#0 2.170 File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 472, in __init__
#0 2.170 self._wadl = self._browser.get_wadl_application(self._root_uri)
#0 2.170 File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 447, in get_wadl_application
#0 2.170 response, content = self._request(url, media_type=wadl_type)
#0 2.170 File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 389, in _request
#0 2.170 response, content = self._request_and_retry(
#0 2.170 File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 359, in _request_and_retry
#0 2.170 response, content = self._connection.request(
#0 2.170 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1725, in request
#0 2.171 (response, content) = self._request(
#0 2.171 File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 144, in _request
#0 2.171 response, content = super(LaunchpadOAuthAwareHttp, self)._request(
#0 2.171 File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 184, in _request
#0 2.171 return super(RestfulHttp, self)._request(
#0 2.171 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1441, in _request
#0 2.171 (response, content) = self._conn_request(conn, request_uri, method, body, headers)
#0 2.171 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1363, in _conn_request
#0 2.171 conn.connect()
#0 2.171 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1199, in connect
#0 2.172 raise socket_err
#0 2.172 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1153, in connect
#0 2.172 sock.connect((self.host, self.port))
#0 2.172 OSError: [Errno 99] Cannot assign requested address
I've tried two solutions, first is to use the option --network=host
I've modified the build step to
docker build --network=host -t $tag .
then I got this error
File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 230, in __init__
super(Launchpad, self).__init__(
File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 472, in __init__
self._wadl = self._browser.get_wadl_application(self._root_uri)
File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 447, in get_wadl_application
response, content = self._request(url, media_type=wadl_type)
File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 389, in _request
response, content = self._request_and_retry(
File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 359, in _request_and_retry
response, content = self._connection.request(
File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1725, in request
(response, content) = self._request(
File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 144, in _request
response, content = super(LaunchpadOAuthAwareHttp, self)._request(
File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 184, in _request
return super(RestfulHttp, self)._request(
File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1441, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1363, in _conn_request
conn.connect()
File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1153, in connect
sock.connect((self.host, self.port))
TimeoutError: [Errno 110] Connection timed out
The second solution is to use add-host, I modified the build command to:
docker build --add-host dockerhost:`/sbin/ip route|awk '/default/ { print $3}'` -t $tag .
I got the OSError: [Errno 99] Cannot assign requested address like before.
I can build the input Dockerfile locally on my computer, I'm not sure what might be the correct network configuration to make this work on a k8s environment.
I have the following dockerfile:
FROM ubuntu:20.04
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
wget \
build-essential \
curl \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget --no-check-certificate -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash miniconda.sh -b \
&& rm -f miniconda.sh
ENV PATH="/root/miniconda3/bin:${PATH}"
WORKDIR /home
#COPY download_model.sh download_model.sh
#RUN /bin/bash /home/download_model.sh
RUN conda config --set ssl_verify false
#RUN curl -I https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json -k
RUN conda install pytorch==1.4.0 torchvision==0.5.0 cpuonly -c pytorch
COPY requirements.txt requirements.txt
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
#RUN pip install -r requirements.txt
COPY m39v1.tar ./
RUN tar -xvf m39v1.tar && rm -f m39v1.tar
COPY src src/
COPY test_bin test_bin/
COPY run_paraphraser.py run_paraphraser.py
ENTRYPOINT ["python", "run_paraphraser.py"]
I'm having problems with running pip install, more specifically i've had to replace this command RUN pip install -r requirements.txt with RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
Otherwise i was getting this wierd ssl certificate error:
#12 8.692 Could not fetch URL https://pypi.org/simple/config/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/config/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) - skipping
#12 8.694 ERROR: Could not find a version that satisfies the requirement config (from versions: none)
#12 8.695 ERROR: No matching distribution found for config
#12 9.195 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) - skipping
#12 ERROR: executor failed running [/bin/sh -c pip install -r requirements.txt config --global http.sslVerify false]: exit code:
I'm on a company laptop, however the problem arised only when trying to reach the website from docker, i noticed the problem when i added this line RUN curl -I https://pypi.org/simple/pip/ to the dockerfile to test connection to pip:
#10 [ 7/14] RUN curl -I https://pypi.org/simple/pip/
#10 sha256:95fa072f708fe705a1d5a9f7af20972255a078ce1df2cf90ad52a4d9a844ec40
#10 0.378 % Total % Received % Xferd Average Speed Time Time Time Current
#10 0.378 Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
#10 0.412 curl: (77) error setting certificate verify locations:
#10 0.412 CAfile: /etc/ssl/certs/ca-certificates.crt
#10 0.412 CApath: /etc/ssl/certs
#10 ERROR: executor failed running [/bin/sh -c curl -I https://pypi.org/simple/pip/]: exit code: 77
As i've mentioned replacing pip install with this trusted version seemed to work initially RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
However when building the dockerfile i ended up with another error which i can't really wrap my head around:
#13 [ 9/14] RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
#13 sha256:1e3540de7554d95d43c31a02a3079a9d8c5a8104255b93ca63d4dd006e1df31e
#13 0.881 Collecting sentencepiece==0.1.86
#13 1.057 Downloading sentencepiece-0.1.86-cp37-cp37m-manylinux1_x86_64.whl (1.0 MB)
#13 1.368 Collecting fairseq==0.9.0
#13 3.330 Downloading fairseq-0.9.0.tar.gz (306 kB)
#13 12.30 ERROR: Command errored out with exit status 1:
#13 12.30 command: /root/miniconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_2im9ux1/fairseq/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_2im9ux1/fairseq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-_2im9ux1/fairseq/pip-egg-info
#13 12.30 cwd: /tmp/pip-install-_2im9ux1/fairseq/
#13 12.30 Complete output (39 lines):
#13 12.30 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 ERROR: Could not find a version that satisfies the requirement cython (from versions: none)
#13 12.30 ERROR: No matching distribution found for cython
#13 12.30 /root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
#13 12.30 SetuptoolsDeprecationWarning,
#13 12.30 Traceback (most recent call last):
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
#13 12.30 subprocess.check_call(cmd)
#13 12.30 File "/root/miniconda3/lib/python3.7/subprocess.py", line 363, in check_call
#13 12.30 raise CalledProcessError(retcode, cmd)
#13 12.30 subprocess.CalledProcessError: Command '['/root/miniconda3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp91n1bbee', '--quiet', 'cython']' returned non-zero exit status 1.
#13 12.30
#13 12.30 The above exception was the direct cause of the following exception:
#13 12.30
#13 12.30 Traceback (most recent call last):
#13 12.30 File "<string>", line 1, in <module>
#13 12.30 File "/tmp/pip-install-_2im9ux1/fairseq/setup.py", line 161, in <module>
#13 12.30 zip_safe=False,
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 86, in setup
#13 12.30 _install_setup_requires(attrs)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
#13 12.30 dist.fetch_build_eggs(dist.setup_requires)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py", line 878, in fetch_build_eggs
#13 12.30 replace_conflicting=True,
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
#13 12.30 replace_conflicting=replace_conflicting
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1075, in best_match
#13 12.30 return self.obtain(req, installer)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1087, in obtain
#13 12.30 return installer(requirement)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
#13 12.30 return fetch_build_egg(self, req)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
#13 12.30 raise DistutilsError(str(e)) from e
#13 12.30 distutils.errors.DistutilsError: Command '['/root/miniconda3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp91n1bbee', '--quiet', 'cython']' returned non-zero exit status 1.
#13 12.30 ----------------------------------------
#13 12.31 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#13 ERROR: executor failed running [/bin/sh -c pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt]: exit code: 1
i've also tried to update certificates by adding:
RUN apt-get install ca-certificates -y
RUN update-ca-certificates
with no success. It could be important to know that i've also had the same issue with conda install section: RUN conda install pytorch==1.4.0 torchvision==0.5.0 cpuonly -c pytorch
and i've managed to find a workaround by disabling the certificate verification: RUN conda config --set ssl_verify false
What should i do? thank you!
After building the Docker file, trying to run the image when the python sript starts return this error:
Traceback (most recent call last):
File "/data/ms_rewards_farmer.py", line 815, in <module>
browser = browserSetup(True, PC_USER_AGENT)
File "/data/ms_rewards_farmer.py", line 48, in browserSetup
chrome_browser_obj = webdriver.Chrome(options=options)
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line
69, in __init__
super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line
89, in __init__
self.service.start()
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71,
in start self.process = subprocess.Popen(cmd, env=self.env,
File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/lib/python3.9/subprocess.py", line 1823, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: 'chromedriver'
This is the Dockerfile:
FROM python:3.9.2
RUN mkdir -p /logs
RUN apt-get update
RUN apt install wget
RUN apt-get install -y wget xvfb unzip
# install google chrome
RUN apt-get install -y chromium
# install chromedriver
RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip
RUN mv chromedriver /usr/bin/chromedriver
RUN chown root:root /usr/bin/chromedriver
RUN chmod +x /usr/bin/chromedriver
COPY . /data
WORKDIR /data
RUN pip install --no-cache-dir -r requirements.txt
# set display port to avoid crash
ENV DISPLAY=:99
# Custom Env Vars
ENV DOCKER_IMAGE=true
I don't know what's the problem, i tried to change the installation of chromedriver from the Dockerfile, any ideas?
Requirements.txt:
certifi
chardet
idna
requests
selenium
urllib3
ipapi
schedule
Trying to run FastAPI through docker and I am
facing this error while the Dockerfile runs the requirements.txt file
[4/5] RUN pip install -r ./requirements.txt:
#8 1.640 Processing /home/ktietz/src/ci/alabaster_1611921544520/work
#8 1.644 ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/ktietz/src/ci/alabaster_1611921544520/work'
This is my Dockerfile:
FROM alpine:3.14
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
RUN apk add python3-dev # for python3.x installs
RUN apk add musl-dev
RUN apk add gcc
RUN mkdir -p /usr/src/tap-stashstock
RUN mkdir -p /usr/singer
WORKDIR /usr/src/tap-stashstock
ADD . /usr/src/tap-stashstock
ADD singer /usr/singer
RUN pip3 install --upgrade .
This works and then I run docker run -it stashstock-to-bigquery pip3 install target-bigquery which results in this error
Collecting grpcio<2.0dev,>=1.38.1
Downloading grpcio-1.44.0.tar.gz (21.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.4/21.4 MB 3.9 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-4wuwnk4b/grpcio_429c1ed72b4244a0a71ac7e9f1ec81c6/setup.py", line 256, in <module>
if check_linker_need_libatomic():
File "/tmp/pip-install-4wuwnk4b/grpcio_429c1ed72b4244a0a71ac7e9f1ec81c6/setup.py", line 203, in check_linker_need_libatomic
cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'],
File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'c++'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
What am I missing from my Dockerfile?
This error may for not having a C/C++ compiler.
Try install gcc and build-essensial before pip installation.
Please follow the steps given in
https://github.com/grpc/issues/24556