I have a Docker file with the following:
FROM ubuntu:18.04
RUN apt-get update --fix-missing
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN apt-get install -y build-essential
RUN apt-get install -y python3.8
RUN apt-get install -y python3-pip python3.8-venv python3.8-dev
ENV VIRTUAL_ENV=/run/env
RUN python3.8 -m venv $VIRTUAL_ENV
I get this error when building it:
Step 8/8 : RUN python3.8 -m venv $VIRTUAL_ENV
---> Running in d05326069de2
Error: Command '['/run/env/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']'
returned non-zero exit status 2.
When I try to add this line before it:
RUN python3.8 -m ensurepip --upgrade
I get the error:
File "/usr/lib/python3.8/distutils/sysconfig.py", line 466, in _init_posix
ModuleNotFoundError: No module named '_sysconfigdata__x86_64-linux-gnu'
How do I fix this?
As workaround
sudo ln -s /usr/lib/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py /usr/lib/python3.8/_sysconfigdata__x86_64-linux-gnu.py
But i hope it will be fixed soon in Ubuntu.
oops, this was a mistake in the packaging -- I've gone ahead and fixed it here
there was a subtle conflict between the system python3-distuils
(provided by debian) and the python3.x-venv
module (provided by the ppa)
disclaimer: I'm the maintainer of deadsnakes
For me, I could fix my Python 3.8 installation and the problem with this:
sudo apt --fix-broken install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With