Cannot deploy app | Protobuf Issues

Summary

I’m having a hard time trying to get my app deployed as I keep getting hit with package conflict issues with protobuf.

If I use the latest version of protobuf, the app doesn’t work locally, giving this instruction’ Downgrade the protobuf package to 3.20.x or lower.’

If I downgrade protobuf to 3.20.0 the app works perfectly locally, but then fails deployment as it seems other packages require a more recent protobuf version?

Is there a magic protobuf version I need to use?

Expected behavior:

App gets deployed successfully

Actual behavior:

Deployment fails as ‘Error installing requirements.’

Debug info

ERROR: Cannot install -r /app/file_uploader/requirements.txt (line 18) and protobuf==3.20.0 because these package versions have conflicting dependencies.


The conflict is caused by:

    The user requested protobuf==3.20.0

    google-api-core 2.11.0 depends on protobuf!=3.20.0, !=3.20.1, !=4.21.0, !=4.21.1, !=4.21.2, !=4.21.3, !=4.21.4, !=4.21.5, <5.0.0dev and >=3.19.5


To fix this you could try to:

1. loosen the range of package versions you've specified

2. remove package versions to allow pip attempt to solve the dependency conflict

Requirements file

altair==4.2.0
attrs==22.2.0
beautifulsoup4==4.11.1
BigQuery-Python==1.15.0
blinker==1.5
cachetools==5.2.1
certifi==2022.12.7
charset-normalizer==3.0.1
click==8.1.3
colorama==0.4.6
commonmark==0.9.1
db-dtypes==1.0.5
decorator==5.1.1
entrypoints==0.4
gitdb==4.0.10
GitPython==3.1.30
google==3.0.0
google-api-core==2.11.0
google-api-python-client==2.73.0
google-auth==2.16.0
google-auth-httplib2==0.1.0
google-cloud==0.34.0
google-cloud-bigquery==3.4.2
google-cloud-core==2.3.2
google-cloud-storage==2.7.0
google-crc32c==1.5.0
google-resumable-media==2.4.0
googleapis-common-protos==1.58.0
grpcio==1.51.1
grpcio-status==1.51.1
httplib2==0.21.0
idna==3.4
importlib-metadata==6.0.0
Jinja2==3.1.2
jsonschema==4.17.3
MarkupSafe==2.1.2
numpy==1.24.1
packaging==23.0
pandas==1.5.2
Pillow==9.4.0
proto-plus==1.22.2
protobuf==3.20.0
pyarrow==10.0.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pydeck==0.8.0
Pygments==2.14.0
Pympler==1.0.1
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
pytz==2022.7.1
pytz-deprecation-shim==0.1.0.post0
requests==2.28.2
rich==13.1.0
rsa==4.9
semver==2.13.0
six==1.16.0
smmap==5.0.0
soupsieve==2.3.2.post1
streamlit==1.17.0
toml==0.10.2
toolz==0.12.0
tornado==6.2
typing_extensions==4.4.0
tzdata==2022.7
tzlocal==4.2
uritemplate==4.1.1
urllib3==1.26.14
validators==0.20.0
watchdog==2.2.1
zipp==3.11.0

Hi @Thomas_Ellyatt, welcome to the forum!

Changing these lines worked for me requirements.txt protobuf - Diff Checker with python 3.10.3

Here’s how I went about resolving this:

  1. Tried to install it in a new virtual environment and verified that I got the same error you did
  2. Looked for a compatible version of protobuf according to the error (first tried 3.19.4)
  3. Saw a new issue complaining about 3.19.4, saying some dependencies needed >= 3.19.5, so I tried 3.19.5
  4. Noticed some issues related to grpcio, so I tried unpinning those packages (leaving off the ==) in the requirements.txt, and pip installing to see if it found a compatible version
  5. Once it worked, I used pip freeze | grep grpcio to see what versions got installed, and updated the requirements.txt to reflect those.

Hope this works for you, and those steps are helpful for the future.

2 Likes

You’re a hero, thank you so much!!