error while creating streamlit webapp using google colab for basic image classification webapp

Viewed 3131

I am trying to create a simple classification web app, referening the article -https://towardsdatascience.com/deploying-an-image-classification-web-app-with-python-3753c46bb79 . i am trying this article in Google colab env, while creating the streamlit webapp i obtained following error during running a command line - streamlit run rps_app.py ERROR

ContextualVersionConflict                 Traceback (most recent call last)
<ipython-input-15-7d4ea1e3639a> in <module>()
      1 import numpy as np
----> 2 import streamlit as st
      3 import tensorflow as tf
      4 from PIL import Image, ImageOps
      5 

4 frames
/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
    789                 # Oops, the "best" so far conflicts with a dependency
    790                 dependent_req = required_by[req]
--> 791                 raise VersionConflict(dist, req).with_context(dependent_req)
    792 
    793             # push the new requirements onto the stack

ContextualVersionConflict: (ipykernel 4.10.1 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('ipykernel>=5.1.2; python_version >= "3.4"'), {'pydeck'})``
3 Answers

Did you try restart the runtime and run again? it worked for me.

I use this source code in colab:

%%writefile app.py
import streamlit as st

After restart the runtime and run again? it worked for me.

Related