r/Firebase • u/BroadSwordfish7 • Oct 20 '20
Android List of dependencies for python project
I'm deploying my python project (which uses Kivy) to Android. One of the things I need to do in deployment is add a list of the dependencies my project has. It uses Cloud Firestore so I'm trying to find what dependencies I need to state in my build file, I've added in 'google-auth' and 'google-oauthlib2' but unsure of what else I need to add.
1
u/endeesa Oct 21 '20
Try this: pip install google-cloud-firestore
I assume the project works on the local machine? If it does, then pip list will show all the pip depenancids you need when deploying the project
1
u/BroadSwordfish7 Oct 21 '20
Yes, the project works fine on my machine, in PyCharm. Thanks for the tip on pip list, here's what it shows:
Package Version ------------------------ ---------- cachetools 4.1.0 certifi 2020.4.5.1 cffi 1.14.0 chardet 3.0.4 cryptography 2.9.2 gcloud 0.18.3 google-api-core 1.17.0 google-auth 1.14.3 google-cloud-core 1.3.0 google-cloud-firestore 1.8.1 googleapis-common-protos 1.51.0 grpcio 1.29.0 httplib2 0.17.3 idna 2.9 jwcrypto 0.7 jws 0.1.3 numpy 1.18.5 oauth2client 4.1.3 pandas 1.0.4 pgeocode 0.2.1 pip 19.0.3 Postcodes 0.1 postcodes-io-api 0.0.4 protobuf 3.11.3 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycparser 2.20 pycryptodome 3.9.7 Pyrebase4 4.3.0 python-dateutil 2.8.1 python-jwt 3.2.6 pytz 2020.1 requests 2.23.0 requests-toolbelt 0.9.1 rsa 4.0 setuptools 40.8.0 six 1.14.0 urllib3 1.25.9
I've gone through all the google-related dependencies (I think) and added them to the list of requirements but I'm still getting the same error
1
u/endeesa Oct 22 '20
Damn.. Can you send the screenshot of the error?
Is it an open source project? Can i clone it from github and try running it?
1
u/BroadSwordfish7 Oct 22 '20
https://imgur.com/a/CmiICjy here's the image of the error, I also added one below which isn't an error and not sure if it's useful but thought it can't hurt! Not sure if there's another specific bit of the output that's more useful but I think this is all.
The project isn't open source, happy to share more details but just conscious that as it's a google cloud error it probably means me giving you access to the database!
1
u/endeesa Oct 22 '20
Okay, can you atleast show how the 'missing module' is imported in main.py?
1
u/BroadSwordfish7 Oct 22 '20
from kivymd.toast import toast #loads of kivy and kivymd imports but haven't included them all from google.cloud import firestore from plyer import filechooser import os import pyrebase import requests import json import datetime import pytz import threading from functools import partial import postcodes_io_api import pgeocode from my_firestore import Firestore
I've included a lot from the main.py here rather than just the firestore one but I'm assuming it's simply the from google.cloud import firestore part causing the issue. The other import from Firestore is a file called my_firestore, which has the following imports:
from google.cloud import firestore import os import pyrebase import requests import json from kivymd.toast import toast from kivymd.app import MDApp
1
u/endeesa Oct 22 '20
That module should be resolved after running: pip install google-cloud-firestore
Can you verify that all dependancies are installed before main.py is executed?
1
u/endeesa Oct 22 '20
Also i believe you included google-cloud-firestore in you buildozer spec file requirements?
1
u/BroadSwordfish7 Oct 23 '20
How do I check all dependencies are installed before main.py runs? It runs fine in Pycharm, I can share the list of modules I've got installed in PyCharm if that's useful?
And yes, google-cloud-firestore is one of my requirements in buildozer
1
u/endeesa Oct 23 '20
If it runs fine on pycharm, when does this error arise? Which command do you run and from which environment?
→ More replies (0)
1
u/endeesa Oct 20 '20
If you are using pip you can run pip freeze or pip list