Streamlit hello returns ImportError

I recently added streamlit to a mini python program and got an error when running streamlit hello. Attached is an image of the error. I’d appreciate any help here!

Traceback (most recent call last):
  File "/Users/quannguyen/.local/share/virtualenvs/event-hours-calculator-tFSD0Fkz/bin/streamlit", line 5, in <module> from streamlit.web.cli import main

  File "/Users/quannguyen/.local/share/virtualenvs/event-hours-calculator-tFSD0Fkz/lib/python3.10/site-packages/streamlit/__init__.py", line 48, in <module> from streamlit.proto.RootContainer_pb2 import RootContainer

  File "/Users/quannguyen/.local/share/virtualenvs/event-hours-calculator-tFSD0Fkz/lib/python3.10/site-packages/streamlit/proto/RootContainer_pb2.py", line 6, in <module> from google.protobuf import descriptor as _descriptor

  File "/Users/quannguyen/.local/share/virtualenvs/event-hours-calculator-tFSD0Fkz/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 47, in <module> from google.protobuf.pyext import _message

ImportError: dlopen(/Users/quannguyen/.local/share/virtualenvs/event-hours-calculator-tFSD0Fkz/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN6google8protobuf15FieldDescriptor12TypeOnceInitEPKS1_'
1 Like

Looks like downgrading protobuf fixed it for me “pip install protobuf==3.19.4”

2 Likes

That did it. Thank you so much!

I created an issue to track this protobuf error on clean streamlit install of 1.12.3 · Issue #5394 · streamlit/streamlit · GitHub

1 Like