Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError #5867

Closed
3 of 5 tasks
donhuvy opened this issue Dec 17, 2022 · 4 comments
Closed
3 of 5 tasks

ImportError #5867

donhuvy opened this issue Dec 17, 2022 · 4 comments
Labels
type:bug Something isn't working

Comments

@donhuvy
Copy link

donhuvy commented Dec 17, 2022

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

error ImportError

Collecting streamlit
  Downloading streamlit-1.16.0-py2.py3-none-any.whl (9.2 MB)
Requirement already satisfied: cachetools>=4.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (5.2.0)
Requirement already satisfied: packaging>=14.1 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (21.3)
Collecting watchdog; platform_system != "Darwin"
  Downloading watchdog-2.2.0-py3-none-win_amd64.whl (78 kB)
Requirement already satisfied: toml in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (0.10.2)
Collecting pydeck>=0.1.dev5
  Downloading pydeck-0.8.0-py2.py3-none-any.whl (4.7 MB)
Collecting altair>=3.2.0
  Downloading altair-4.2.0-py3-none-any.whl (812 kB)
Collecting rich>=10.11.0
  Downloading rich-12.6.0-py3-none-any.whl (237 kB)
Requirement already satisfied: tornado>=5.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (6.2)
Requirement already satisfied: numpy in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (1.23.4)
Collecting blinker>=1.0.0
  Downloading blinker-1.5-py2.py3-none-any.whl (12 kB)
Collecting pyarrow>=4.0
  Downloading pyarrow-10.0.1-cp39-cp39-win_amd64.whl (20.3 MB)
Requirement already satisfied: pillow>=6.2.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (9.3.0)
Requirement already satisfied: requests>=2.4 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (2.28.1)
Collecting gitpython!=3.1.19
  Downloading GitPython-3.1.29-py3-none-any.whl (182 kB)
Requirement already satisfied: python-dateutil in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (2.8.2)
Requirement already satisfied: protobuf<4,>=3.12 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (3.19.6)
Collecting tzlocal>=1.1
  Downloading tzlocal-4.2-py3-none-any.whl (19 kB)
Requirement already satisfied: pandas>=0.21.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (1.5.1)
Requirement already satisfied: click>=7.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (8.1.3)
Collecting semver
  Downloading semver-2.13.0-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: importlib-metadata>=1.4 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (5.0.0)
Collecting validators>=0.2
  Downloading validators-0.20.0.tar.gz (30 kB)
Requirement already satisfied: typing-extensions>=3.10.0.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from streamlit) (4.4.0)
Collecting pympler>=0.9
  Downloading Pympler-1.0.1-py3-none-any.whl (164 kB)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from packaging>=14.1->streamlit) (3.0.9)
Requirement already satisfied: jinja2>=2.10.1 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from pydeck>=0.1.dev5->streamlit) (3.1.2)
Requirement already satisfied: jsonschema>=3.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from altair>=3.2.0->streamlit) (4.17.0)
Requirement already satisfied: entrypoints in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from altair>=3.2.0->streamlit) (0.4)
Collecting toolz
  Downloading toolz-0.12.0-py3-none-any.whl (55 kB)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from rich>=10.11.0->streamlit) (2.13.0)
Collecting commonmark<0.10.0,>=0.9.0
  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Requirement already satisfied: idna<4,>=2.5 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from requests>=2.4->streamlit) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from requests>=2.4->streamlit) (1.26.12)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from requests>=2.4->streamlit) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from requests>=2.4->streamlit) (2022.9.24)
Collecting gitdb<5,>=4.0.1
  Downloading gitdb-4.0.10-py3-none-any.whl (62 kB)
Requirement already satisfied: six>=1.5 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from python-dateutil->streamlit) (1.16.0)
Collecting tzdata; platform_system == "Windows"
  Downloading tzdata-2022.7-py2.py3-none-any.whl (340 kB)
Collecting pytz-deprecation-shim
  Downloading pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: pytz>=2020.1 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from pandas>=0.21.0->streamlit) (2022.6)
Requirement already satisfied: colorama; platform_system == "Windows" in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from click>=7.0->streamlit) (0.4.6)
Requirement already satisfied: zipp>=0.5 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from importlib-metadata>=1.4->streamlit) (3.10.0)
Requirement already satisfied: decorator>=3.4.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from validators>=0.2->streamlit) (5.1.1)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from jinja2>=2.10.1->pydeck>=0.1.dev5->streamlit) (2.1.1)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from jsonschema>=3.0->altair>=3.2.0->streamlit) (0.19.2)
Requirement already satisfied: attrs>=17.4.0 in c:\users\donhu\appdata\local\programs\python\python39\lib\site-packages (from jsonschema>=3.0->altair>=3.2.0->streamlit) (22.1.0)
Collecting smmap<6,>=3.0.1
  Downloading smmap-5.0.0-py3-none-any.whl (24 kB)
Building wheels for collected packages: validators
  Building wheel for validators (setup.py): started
  Building wheel for validators (setup.py): finished with status 'done'
  Created wheel for validators: filename=validators-0.20.0-py3-none-any.whl size=19577 sha256=e6e7c30c9929e78c22ee0476f123cd69685c4104430bd9dd4166e28643551a68
  Stored in directory: c:\users\donhu\appdata\local\pip\cache\wheels\2d\f0\a8\1094fca7a7e5d0d12ff56e0c64675d72aa5cc81a5fc200e849
Successfully built validators
Installing collected packages: watchdog, pydeck, toolz, altair, commonmark, rich, blinker, pyarrow, smmap, gitdb, gitpython, tzdata, pytz-deprecation-shim, tzlocal, semver, validators, pympler, streamlit
Successfully installed altair-4.2.0 blinker-1.5 commonmark-0.9.1 gitdb-4.0.10 gitpython-3.1.29 pyarrow-10.0.1 pydeck-0.8.0 pympler-1.0.1 pytz-deprecation-shim-0.1.0.post0 rich-12.6.0 semver-2.13.0 smmap-5.0.0 streamlit-1.16.0 toolz-0.12.0 tzdata-2022.7 tzlocal-4.2 validators-0.20.0 watchdog-2.2.0
WARNING: You are using pip version 20.2.3; however, version 22.3.1 is available.
You should consider upgrading via the 'c:\users\donhu\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In [1], line 3
      1 get_ipython().system('pip install streamlit')
----> 3 import streamlit as st
      4 import pandas as pd
      5 import numpy as np

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\__init__.py:55
     52 # Give the package a version.
     53 __version__ = _STREAMLIT_VERSION_STRING
---> 55 from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
     56 from streamlit.proto.RootContainer_pb2 import RootContainer as _RootContainer
     57 from streamlit.runtime.caching import (
     58     singleton as _singleton,
     59     memo as _memo,
     60 )

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\delta_generator.py:38
     35 import click
     36 from typing_extensions import Final, Literal
---> 38 from streamlit import config, cursor, env_util, logger, runtime, type_util, util
     39 from streamlit.cursor import Cursor
     40 from streamlit.elements.alert import AlertMixin

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\cursor.py:18
     15 from typing import Any, List, Optional, Tuple
     17 from streamlit import util
---> 18 from streamlit.runtime.scriptrunner import get_script_run_ctx
     21 def make_delta_path(
     22     root_container: int, parent_path: Tuple[int, ...], index: int
     23 ) -> List[int]:
     24     delta_path = [root_container]

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\runtime\__init__.py:16
      1 # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     14 
     15 # Explicitly re-export public symbols from runtime.py
---> 16 from streamlit.runtime.runtime import Runtime as Runtime
     17 from streamlit.runtime.runtime import RuntimeConfig as RuntimeConfig
     18 from streamlit.runtime.runtime import RuntimeState as RuntimeState

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\runtime\runtime.py:26
     24 from streamlit import config
     25 from streamlit.logger import get_logger
---> 26 from streamlit.proto.BackMsg_pb2 import BackMsg
     27 from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
     28 from streamlit.runtime.app_session import AppSession

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\proto\BackMsg_pb2.py:5
      1 # -*- coding: utf-8 -*-
      2 # Generated by the protocol buffer compiler.  DO NOT EDIT!
      3 # source: streamlit/proto/BackMsg.proto
      4 """Generated protocol buffer code."""
----> 5 from google.protobuf.internal import builder as _builder
      6 from google.protobuf import descriptor as _descriptor
      7 from google.protobuf import descriptor_pool as _descriptor_pool

ImportError: cannot import name 'builder' from 'google.protobuf.internal' (C:\Users\donhu\AppData\Local\Programs\Python\Python39\lib\site-packages\google\protobuf\internal\__init__.py)

Reproducible Code Example

!pip install streamlit

import streamlit as st
import pandas as pd
import numpy as np

st.title('Bar')

# Defining dataframe with its values 
df = pd.DataFrame(
    np.random.randn(40, 4),
    columns=["C1", "C2", "C3", "C4"])

# Bar Chart 
st.bar_chart(df)

Steps To Reproduce

Run example with Jupyter lab or GitHub codespace.

Expected Behavior

Import success.

Current Behavior

Exception when import.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version:
  • Python version:
  • Operating System:
  • Browser:
  • Virtual environment:

Additional Information

No response

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!
@donhuvy donhuvy added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Dec 17, 2022
@donhuvy
Copy link
Author

donhuvy commented Dec 17, 2022

2022-12-17_12-34-33.mp4

@donhuvy
Copy link
Author

donhuvy commented Dec 17, 2022

@donhuvy donhuvy closed this as completed Dec 17, 2022
rejasupotaro added a commit to rejasupotaro/amazon-product-search that referenced this issue Dec 19, 2022
@kmcgrady kmcgrady removed the status:needs-triage Has not been triaged by the Streamlit team label Dec 30, 2022
@DouglasLivingstone
Copy link

DouglasLivingstone commented Jan 5, 2023

The fix in the Stack Overflow post is to install protobuf==4.21 with pip, however in #5626 the comment from @willhuang1997 says that this would likely break:

Hi, yes there would be concerns for bumping protobuf! This would likely break streamlit as it's a major version change and would require a decent amount of refactoring.

As a workaround for this error, I've downgraded Streamlit to 1.15.2.

@crclark
Copy link

crclark commented Jan 11, 2023

Upgrading protobuf is not a fix. Streamlit should fix the range on their protobuf dep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants