You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think your issue is that you have a file called anybadge.py, which means, in your code when you run import anybadge you are actually importing your anybadge.py file, and not the anybadge package.
You should be able to fix this by using a different filename (e.g. run_anybadge.py) and then using:
FROM python:3.7
RUN apt-get update -y && \
apt-get install nano -y && \
pip install anybadge && \
pip list
COPY . /opt
RUN python /opt/run_anybadge.py
You could also consider running anybadge as a command rather than in Python, meaning you don't even need the Python module, so something like this:
FROM python:3.7
RUN apt-get update -y && \
apt-get install nano -y && \
pip install anybadge && \
pip list
RUN anybadge --value=2.22 --file=pylint.svg pylint
Hi there, I'm trying to use code snippet from README.md:
And getting
ImportError: cannot import name 'Badge' from 'anybadge'
error.Reproduced in both Python 2.7 and 3.7 environments, I used Docker:
..and
anybadge.py
with code aboveThe text was updated successfully, but these errors were encountered: