Strealit version import error while running code

Summary

while running sample program which is using starlit library is failing with
from streamlit.version import STREAMLIT_VERSION_STRING as _STREAMLIT_VERSION_STRING
import packaging.version
ModuleNotFoundError: No module named ‘packaging’

Steps to reproduce

while trying to install matplotlib library using install pip matplotlib.

Code snippet:

add code here
import streamlit as st
import numpy as np
import pandas as pd
import openai

# Uncomment this if you want the random chart to display
chart_data = pd.DataFrame(
    np.random.randn(20, 3),
    columns=['a', 'b', 'c']
)
st.line_chart(chart_data)

If applicable, please provide the steps we should take to reproduce the error or specified behavior.

Expected behavior:

Explain what you expect to happen when you run the code above.

Actual behavior:

Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.

Debug info

  • Streamlit version: (get it with $ streamlit version)
  • Python version: (get it with $ python --version)
  • Using Conda? PipEnv? PyEnv? Pex?
  • OS version:
  • Browser version:

Requirements file

Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.

Links

  • Link to your GitHub repo:
  • Link to your deployed app:

Additional information

If needed, add any other context about the problem here.

Hi @Kajal_Das,

Can you try installing this?

https://pypi.org/project/packaging/

Hopefully, it should solve your issue.

Best,
Charly

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.