Docker run command is giving ImportError[BUG]
manishgaur101 opened this issue · 3 comments
manishgaur101 commented
riceball1 commented
I have the same issue, I'm trying to upgrade from python3 3.7 to 3.9.9 right now to see if it helps
update: did not work, although using an venv I was able to at least run the flask app, but not via docker unfortunately.... still looking for answers 👀
Trying to see how to fix it by patching the ImportError
here
manishgaur101 commented
It worked for me when I upgraded to 3.9 version.
…On Mon, Jan 3, 2022 at 3:50 AM Dana Ng ***@***.***> wrote:
I have the same issue, I'm trying to upgrade from python3 to 3.7 right now
to see if it helps
—
Reply to this email directly, view it on GitHub
<#322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHQFEUKVQEBEB5DAP6CF2N3UUDFR5ANCNFSM5LBUBBGQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Thanks,
Manish Kumar Gaur
Ph: +91-8376029046
riceball1 commented
So because I couldn't get it to work with FROM python:3
I changed it to FROM python:2
and also updated the following in the Dockerfile:
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
Rebuilt the docker and then reran it, and everything worked!
The final code, and I only it seems needed to change the initial FROM
line
FROM python:2
# set a directory for the app
WORKDIR /usr/src/app
# copy all the files to the container
COPY . .
# install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# tell the port number the container should expose
EXPOSE 5000
# run the command
CMD ["python", "./app.py"]