We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
protobuf error on clean streamlit install of 1.12.3
### Summary

I installed streamlit, and couldn't use it due to a reported error from protobuf. Protobuf version 3.20.2 was installed automatically along with streamlit.

### Steps to reproduce

Code snippet:

```
pip install streamlit
streamlit run something.py
```

Error
```
streamlit run app.py

Traceback (most recent call last):
  File "/private/tmp/tttt/.direnv/python-3.10.3/bin/streamlit", line 5, in <module>
    from streamlit.web.cli import main
  File "/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/streamlit/__init__.py", line 48, in <module>
    from streamlit.proto.RootContainer_pb2 import RootContainer
  File "/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/streamlit/proto/RootContainer_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
ImportError: dlopen(/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (__ZN6google8protobuf15FieldDescriptor12TypeOnceInitEPKS1_)
```

This was solved by downgrading protobuf 
```
pip install protobuf==3.19.4
```
(Please provide a code snippet! This will help expedite us finding and solving the problem.)

If applicable, please provide the steps we should take to reproduce the bug:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'

**Expected behavior:**

App opens

**Actual behavior:**

Error message

### Is this a regression?

Yes

### Debug info

- Streamlit version: (get it with `$ streamlit version`) 
```
In [4]: version._get_installed_streamlit_version()
Out[4]: <Version('1.12.3.dev20220919')>
```
- Python version: (get it with `$ python --version`) 3.10.3
- Using Conda? PipEnv? PyEnv? Pex? pyenv
- OS version: OSX
- Browser version: 

### Additional information

Came from https://discuss.streamlit.io/t/streamlit-hello-returns-importerror/30929/3?u=blackary

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lib/setup.py`
Content:
```
1 # Copyright 2018-2022 Streamlit Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #    http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import os
16 import setuptools
17 import sys
18 
19 from setuptools.command.install import install
20 
21 VERSION = "1.12.2"  # PEP-440
22 
23 NAME = "streamlit"
24 
25 DESCRIPTION = "The fastest way to build data apps in Python"
26 
27 LONG_DESCRIPTION = (
28     "Streamlit's open-source app framework is the easiest way "
29     "for data scientists and machine learning engineers to "
30     "create beautiful, performant apps in only a few hours! "
31     "All in pure Python. All for free."
32 )
33 
34 # IMPORTANT: We should try very hard *not* to add dependencies to Streamlit.
35 # And if you do add one, make the required version as general as possible.
36 # But include relevant lower bounds for any features we use from our dependencies.
37 INSTALL_REQUIRES = [
38     "altair>=3.2.0",
39     "blinker>=1.0.0",
40     "cachetools>=4.0",
41     "click>=7.0",
42     # 1.4 introduced the functionality found in python 3.8's importlib.metadata module
43     "importlib-metadata>=1.4",
44     "numpy",
45     "packaging>=14.1",
46     "pandas>=0.21.0",
47     "pillow>=6.2.0",
48     "protobuf<4,>=3.12",
49     "pyarrow>=4.0",
50     "pydeck>=0.1.dev5",
51     "pympler>=0.9",
52     "python-dateutil",
53     "requests>=2.4",
54     "rich>=10.11.0",
55     "semver",
56     "toml",
57     # 5.0 has a fix for etag header: https://github.com/tornadoweb/tornado/issues/2262
58     "tornado>=5.0",
59     "typing-extensions>=3.10.0.0",
60     "tzlocal>=1.1",
61     "validators>=0.2",
62     # Don't require watchdog on MacOS, since it'll fail without xcode tools.
63     # Without watchdog, we fallback to a polling file watcher to check for app changes.
64     "watchdog; platform_system != 'Darwin'",
65 ]
66 
67 # We want to exclude some dependencies in our internal conda distribution of
68 # Streamlit.
69 CONDA_OPTIONAL_DEPENDENCIES = [
70     "gitpython!=3.1.19",
71 ]
72 
73 # NOTE: ST_CONDA_BUILD is used here (even though CONDA_BUILD is set
74 # automatically when using the `conda build` command) because the
75 # `load_setup_py_data()` conda build helper function does not have the
76 # CONDA_BUILD environment variable set when it runs to generate our build
77 # recipe from meta.yaml.
78 if not os.getenv("ST_CONDA_BUILD"):
79     INSTALL_REQUIRES.extend(CONDA_OPTIONAL_DEPENDENCIES)
80 
81 
82 class VerifyVersionCommand(install):
83     """Custom command to verify that the git tag matches our version"""
84 
85     description = "verify that the git tag matches our version"
86 
87     def run(self):
88         tag = os.getenv("CIRCLE_TAG")
89 
90         if tag != VERSION:
91             info = "Git tag: {0} does not match the version of this app: {1}".format(
92                 tag, VERSION
93             )
94             sys.exit(info)
95 
96 
97 setuptools.setup(
98     name=NAME,
99     version=VERSION,
100     description=DESCRIPTION,
101     long_description=LONG_DESCRIPTION,
102     url="https://streamlit.io",
103     project_urls={
104         "Source": "https://github.com/streamlit/streamlit",
105     },
106     author="Streamlit Inc",
107     author_email="hello@streamlit.io",
108     # We exclude Python 3.9.7 from our compatible versions due to a bug in that version
109     # with typing.Protocol. See https://github.com/streamlit/streamlit/issues/5140 and
110     # https://bugs.python.org/issue45121
111     python_requires=">=3.7, !=3.9.7",
112     license="Apache 2",
113     # PEP 561: https://mypy.readthedocs.io/en/stable/installed_packages.html
114     package_data={"streamlit": ["py.typed", "hello/**/*.py"]},
115     packages=setuptools.find_packages(exclude=["tests", "tests.*"]),
116     # Requirements
117     install_requires=INSTALL_REQUIRES,
118     zip_safe=False,  # install source files not egg
119     include_package_data=True,  # copy html and friends
120     entry_points={"console_scripts": ["streamlit = streamlit.web.cli:main"]},
121     # For Windows so that streamlit * commands work ie.
122     # - streamlit version
123     # - streamlit hello
124     scripts=["bin/streamlit.cmd"],
125     cmdclass={
126         "verify": VerifyVersionCommand,
127     },
128 )
129
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lib/setup.py b/lib/setup.py
--- a/lib/setup.py
+++ b/lib/setup.py
@@ -45,7 +45,8 @@
     "packaging>=14.1",
     "pandas>=0.21.0",
     "pillow>=6.2.0",
-    "protobuf<4,>=3.12",
+    # protobuf 3.20.2 is broken: https://github.com/protocolbuffers/protobuf/issues/10571
+    "protobuf<4,>=3.12,!=3.20.2",
     "pyarrow>=4.0",
     "pydeck>=0.1.dev5",
     "pympler>=0.9",

{"golden_diff": "diff --git a/lib/setup.py b/lib/setup.py\n--- a/lib/setup.py\n+++ b/lib/setup.py\n@@ -45,7 +45,8 @@\n     \"packaging>=14.1\",\n     \"pandas>=0.21.0\",\n     \"pillow>=6.2.0\",\n-    \"protobuf<4,>=3.12\",\n+    # protobuf 3.20.2 is broken: https://github.com/protocolbuffers/protobuf/issues/10571\n+    \"protobuf<4,>=3.12,!=3.20.2\",\n     \"pyarrow>=4.0\",\n     \"pydeck>=0.1.dev5\",\n     \"pympler>=0.9\",\n", "issue": "protobuf error on clean streamlit install of 1.12.3\n### Summary\r\n\r\nI installed streamlit, and couldn't use it due to a reported error from protobuf. Protobuf version 3.20.2 was installed automatically along with streamlit.\r\n\r\n### Steps to reproduce\r\n\r\nCode snippet:\r\n\r\n```\r\npip install streamlit\r\nstreamlit run something.py\r\n```\r\n\r\nError\r\n```\r\nstreamlit run app.py\r\n\r\nTraceback (most recent call last):\r\n  File \"/private/tmp/tttt/.direnv/python-3.10.3/bin/streamlit\", line 5, in <module>\r\n    from streamlit.web.cli import main\r\n  File \"/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/streamlit/__init__.py\", line 48, in <module>\r\n    from streamlit.proto.RootContainer_pb2 import RootContainer\r\n  File \"/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/streamlit/proto/RootContainer_pb2.py\", line 6, in <module>\r\n    from google.protobuf import descriptor as _descriptor\r\n  File \"/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/google/protobuf/descriptor.py\", line 47, in <module>\r\n    from google.protobuf.pyext import _message\r\nImportError: dlopen(/private/tmp/tttt/.direnv/python-3.10.3/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (__ZN6google8protobuf15FieldDescriptor12TypeOnceInitEPKS1_)\r\n```\r\n\r\nThis was solved by downgrading protobuf \r\n```\r\npip install protobuf==3.19.4\r\n```\r\n(Please provide a code snippet! This will help expedite us finding and solving the problem.)\r\n\r\nIf applicable, please provide the steps we should take to reproduce the bug:\r\n\r\n1. Go to '...'\r\n2. Click on '....'\r\n3. Scroll down to '....'\r\n\r\n**Expected behavior:**\r\n\r\nApp opens\r\n\r\n**Actual behavior:**\r\n\r\nError message\r\n\r\n### Is this a regression?\r\n\r\nYes\r\n\r\n### Debug info\r\n\r\n- Streamlit version: (get it with `$ streamlit version`) \r\n```\r\nIn [4]: version._get_installed_streamlit_version()\r\nOut[4]: <Version('1.12.3.dev20220919')>\r\n```\r\n- Python version: (get it with `$ python --version`) 3.10.3\r\n- Using Conda? PipEnv? PyEnv? Pex? pyenv\r\n- OS version: OSX\r\n- Browser version: \r\n\r\n### Additional information\r\n\r\nCame from https://discuss.streamlit.io/t/streamlit-hello-returns-importerror/30929/3?u=blackary\n", "before_files": [{"content": "# Copyright 2018-2022 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport setuptools\nimport sys\n\nfrom setuptools.command.install import install\n\nVERSION = \"1.12.2\"  # PEP-440\n\nNAME = \"streamlit\"\n\nDESCRIPTION = \"The fastest way to build data apps in Python\"\n\nLONG_DESCRIPTION = (\n    \"Streamlit's open-source app framework is the easiest way \"\n    \"for data scientists and machine learning engineers to \"\n    \"create beautiful, performant apps in only a few hours! \"\n    \"All in pure Python. All for free.\"\n)\n\n# IMPORTANT: We should try very hard *not* to add dependencies to Streamlit.\n# And if you do add one, make the required version as general as possible.\n# But include relevant lower bounds for any features we use from our dependencies.\nINSTALL_REQUIRES = [\n    \"altair>=3.2.0\",\n    \"blinker>=1.0.0\",\n    \"cachetools>=4.0\",\n    \"click>=7.0\",\n    # 1.4 introduced the functionality found in python 3.8's importlib.metadata module\n    \"importlib-metadata>=1.4\",\n    \"numpy\",\n    \"packaging>=14.1\",\n    \"pandas>=0.21.0\",\n    \"pillow>=6.2.0\",\n    \"protobuf<4,>=3.12\",\n    \"pyarrow>=4.0\",\n    \"pydeck>=0.1.dev5\",\n    \"pympler>=0.9\",\n    \"python-dateutil\",\n    \"requests>=2.4\",\n    \"rich>=10.11.0\",\n    \"semver\",\n    \"toml\",\n    # 5.0 has a fix for etag header: https://github.com/tornadoweb/tornado/issues/2262\n    \"tornado>=5.0\",\n    \"typing-extensions>=3.10.0.0\",\n    \"tzlocal>=1.1\",\n    \"validators>=0.2\",\n    # Don't require watchdog on MacOS, since it'll fail without xcode tools.\n    # Without watchdog, we fallback to a polling file watcher to check for app changes.\n    \"watchdog; platform_system != 'Darwin'\",\n]\n\n# We want to exclude some dependencies in our internal conda distribution of\n# Streamlit.\nCONDA_OPTIONAL_DEPENDENCIES = [\n    \"gitpython!=3.1.19\",\n]\n\n# NOTE: ST_CONDA_BUILD is used here (even though CONDA_BUILD is set\n# automatically when using the `conda build` command) because the\n# `load_setup_py_data()` conda build helper function does not have the\n# CONDA_BUILD environment variable set when it runs to generate our build\n# recipe from meta.yaml.\nif not os.getenv(\"ST_CONDA_BUILD\"):\n    INSTALL_REQUIRES.extend(CONDA_OPTIONAL_DEPENDENCIES)\n\n\nclass VerifyVersionCommand(install):\n    \"\"\"Custom command to verify that the git tag matches our version\"\"\"\n\n    description = \"verify that the git tag matches our version\"\n\n    def run(self):\n        tag = os.getenv(\"CIRCLE_TAG\")\n\n        if tag != VERSION:\n            info = \"Git tag: {0} does not match the version of this app: {1}\".format(\n                tag, VERSION\n            )\n            sys.exit(info)\n\n\nsetuptools.setup(\n    name=NAME,\n    version=VERSION,\n    description=DESCRIPTION,\n    long_description=LONG_DESCRIPTION,\n    url=\"https://streamlit.io\",\n    project_urls={\n        \"Source\": \"https://github.com/streamlit/streamlit\",\n    },\n    author=\"Streamlit Inc\",\n    author_email=\"hello@streamlit.io\",\n    # We exclude Python 3.9.7 from our compatible versions due to a bug in that version\n    # with typing.Protocol. See https://github.com/streamlit/streamlit/issues/5140 and\n    # https://bugs.python.org/issue45121\n    python_requires=\">=3.7, !=3.9.7\",\n    license=\"Apache 2\",\n    # PEP 561: https://mypy.readthedocs.io/en/stable/installed_packages.html\n    package_data={\"streamlit\": [\"py.typed\", \"hello/**/*.py\"]},\n    packages=setuptools.find_packages(exclude=[\"tests\", \"tests.*\"]),\n    # Requirements\n    install_requires=INSTALL_REQUIRES,\n    zip_safe=False,  # install source files not egg\n    include_package_data=True,  # copy html and friends\n    entry_points={\"console_scripts\": [\"streamlit = streamlit.web.cli:main\"]},\n    # For Windows so that streamlit * commands work ie.\n    # - streamlit version\n    # - streamlit hello\n    scripts=[\"bin/streamlit.cmd\"],\n    cmdclass={\n        \"verify\": VerifyVersionCommand,\n    },\n)\n", "path": "lib/setup.py"}], "after_files": [{"content": "# Copyright 2018-2022 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport setuptools\nimport sys\n\nfrom setuptools.command.install import install\n\nVERSION = \"1.12.2\"  # PEP-440\n\nNAME = \"streamlit\"\n\nDESCRIPTION = \"The fastest way to build data apps in Python\"\n\nLONG_DESCRIPTION = (\n    \"Streamlit's open-source app framework is the easiest way \"\n    \"for data scientists and machine learning engineers to \"\n    \"create beautiful, performant apps in only a few hours! \"\n    \"All in pure Python. All for free.\"\n)\n\n# IMPORTANT: We should try very hard *not* to add dependencies to Streamlit.\n# And if you do add one, make the required version as general as possible.\n# But include relevant lower bounds for any features we use from our dependencies.\nINSTALL_REQUIRES = [\n    \"altair>=3.2.0\",\n    \"blinker>=1.0.0\",\n    \"cachetools>=4.0\",\n    \"click>=7.0\",\n    # 1.4 introduced the functionality found in python 3.8's importlib.metadata module\n    \"importlib-metadata>=1.4\",\n    \"numpy\",\n    \"packaging>=14.1\",\n    \"pandas>=0.21.0\",\n    \"pillow>=6.2.0\",\n    # protobuf 3.20.2 is broken: https://github.com/protocolbuffers/protobuf/issues/10571\n    \"protobuf<4,>=3.12,!=3.20.2\",\n    \"pyarrow>=4.0\",\n    \"pydeck>=0.1.dev5\",\n    \"pympler>=0.9\",\n    \"python-dateutil\",\n    \"requests>=2.4\",\n    \"rich>=10.11.0\",\n    \"semver\",\n    \"toml\",\n    # 5.0 has a fix for etag header: https://github.com/tornadoweb/tornado/issues/2262\n    \"tornado>=5.0\",\n    \"typing-extensions>=3.10.0.0\",\n    \"tzlocal>=1.1\",\n    \"validators>=0.2\",\n    # Don't require watchdog on MacOS, since it'll fail without xcode tools.\n    # Without watchdog, we fallback to a polling file watcher to check for app changes.\n    \"watchdog; platform_system != 'Darwin'\",\n]\n\n# We want to exclude some dependencies in our internal conda distribution of\n# Streamlit.\nCONDA_OPTIONAL_DEPENDENCIES = [\n    \"gitpython!=3.1.19\",\n]\n\n# NOTE: ST_CONDA_BUILD is used here (even though CONDA_BUILD is set\n# automatically when using the `conda build` command) because the\n# `load_setup_py_data()` conda build helper function does not have the\n# CONDA_BUILD environment variable set when it runs to generate our build\n# recipe from meta.yaml.\nif not os.getenv(\"ST_CONDA_BUILD\"):\n    INSTALL_REQUIRES.extend(CONDA_OPTIONAL_DEPENDENCIES)\n\n\nclass VerifyVersionCommand(install):\n    \"\"\"Custom command to verify that the git tag matches our version\"\"\"\n\n    description = \"verify that the git tag matches our version\"\n\n    def run(self):\n        tag = os.getenv(\"CIRCLE_TAG\")\n\n        if tag != VERSION:\n            info = \"Git tag: {0} does not match the version of this app: {1}\".format(\n                tag, VERSION\n            )\n            sys.exit(info)\n\n\nsetuptools.setup(\n    name=NAME,\n    version=VERSION,\n    description=DESCRIPTION,\n    long_description=LONG_DESCRIPTION,\n    url=\"https://streamlit.io\",\n    project_urls={\n        \"Source\": \"https://github.com/streamlit/streamlit\",\n    },\n    author=\"Streamlit Inc\",\n    author_email=\"hello@streamlit.io\",\n    # We exclude Python 3.9.7 from our compatible versions due to a bug in that version\n    # with typing.Protocol. See https://github.com/streamlit/streamlit/issues/5140 and\n    # https://bugs.python.org/issue45121\n    python_requires=\">=3.7, !=3.9.7\",\n    license=\"Apache 2\",\n    # PEP 561: https://mypy.readthedocs.io/en/stable/installed_packages.html\n    package_data={\"streamlit\": [\"py.typed\", \"hello/**/*.py\"]},\n    packages=setuptools.find_packages(exclude=[\"tests\", \"tests.*\"]),\n    # Requirements\n    install_requires=INSTALL_REQUIRES,\n    zip_safe=False,  # install source files not egg\n    include_package_data=True,  # copy html and friends\n    entry_points={\"console_scripts\": [\"streamlit = streamlit.web.cli:main\"]},\n    # For Windows so that streamlit * commands work ie.\n    # - streamlit version\n    # - streamlit hello\n    scripts=[\"bin/streamlit.cmd\"],\n    cmdclass={\n        \"verify\": VerifyVersionCommand,\n    },\n)\n", "path": "lib/setup.py"}]}