question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Streamlit protobuf names may collide with those of other packages

See original GitHub issue

Summary

When import streamlit and supervisely_lib together in a project there occurs a TypeError.

Steps to reproduce

Code snippet:

import streamlit as st
import supervisely_lib as sly

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

  1. run the code with streamlit run …
  2. see error/traceback when you open the streamlit page

Expected behavior:

No error when both libraries are imported together.

Actual behavior:

We get the following error/traceback:

TypeError: Couldn't build proto file into descriptor pool! Invalid proto descriptor for file "worker_api.proto": Empty: "Empty" is already defined in file "streamlit/proto/Empty.proto". Image: "Image" is already defined in file "streamlit/proto/Image.proto". ImagesInfo.infos: "Image" seems to be defined in "streamlit/proto/Image.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. ImagesToAdd.images: "Image" seems to be defined in "streamlit/proto/Image.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. ChunkImage.image: "Image" seems to be defined in "streamlit/proto/Image.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.UploadArchive: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.SetProjectFinished: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.Log: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetNewTask: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetStopTask: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.AgentPing: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.AgentPing: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.UploadModel: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GenerateNewModelId: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetTelemetryTask: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.UpdateTelemetry: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.UploadImages: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetUsedImageList: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetUsedModelList: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetGeneralEventsStream: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.GetGeneralEventData: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.SendGeneralEventData: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. GeneralAPI.AddMetaToProject: "Empty" seems to be defined in "streamlit/proto/Empty.proto", which is not imported by "worker_api.proto". To use it here, please add the necessary import. Traceback: File "/Users/thiemoseys/PycharmProjects/test_streamlit_with_supervisely/venv/lib/python3.8/site-packages/streamlit/script_runner.py", line 333, in _run_script exec(code, module.__dict__) File "/Users/thiemoseys/PycharmProjects/test_streamlit_with_supervisely/test_imports.py", line 1, in <module> import supervisely_lib as sly File "/Users/thiemoseys/PycharmProjects/test_streamlit_with_supervisely/venv/lib/python3.8/site-packages/supervisely_lib/__init__.py", line 64, in <module> import supervisely_lib.worker_proto.worker_api_pb2 as api_proto File "/Users/thiemoseys/PycharmProjects/test_streamlit_with_supervisely/venv/lib/python3.8/site-packages/supervisely_lib/worker_proto/worker_api_pb2.py", line 18, in <module> DESCRIPTOR = _descriptor.FileDescriptor( File "/Users/thiemoseys/PycharmProjects/test_streamlit_with_supervisely/venv/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 965, in __new__ return _message.default_pool.AddSerializedFile(serialized_pb)

Is this a regression?

i do not know if this has ever worked before.

Debug info

  • Streamlit version: 0.79.0
  • Python version: 3.8.3
  • Using Conda? VirtualEnvironment
  • OS version: macos Catalina 10.15.5
  • Browser version: google chrome 89.0.4389.90

Additional information

None

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:19

github_iconTop GitHub Comments

4reactions
unserhcommented, Apr 7, 2021

Hey, alluded-to lurker here, I’d be interested in looking into this issue if you don’t mind!

3reactions
unserhcommented, May 7, 2021

@vdonato no worries at all, I’m definitely still up for it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Streamlit run with protocbuf error
Dear all, I am trying to run streamlit under Ubuntu and get the following error: streamlit Traceback (most recent call last): File ...
Read more >
ImportError: No module named google.protobuf - Stack Overflow
Had the same issue and I resolved it by using : conda install protobuf.
Read more >
Python - CVE - Search Results
The mission of the CVE® Program is to identify, define, and catalog publicly disclosed cybersecurity vulnerabilities.
Read more >
pex_binary - Pants build
A Python target that can be converted into an executable PEX file. ... setting this value risks naming collisions with other package targets...
Read more >
Vulnerability Summary for the Week of August 1, 2022 | CISA
Primary Vendor ‑‑ Product Published CVSS Score @acrontum ‑‑ filesystem‑template 2022‑08‑05 not yet calculated Ittiam ‑‑ libmpeg2 2022‑08‑05 not yet calculated accusoft ‑‑ imagegear 2022‑08‑05 not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found