'google-cloud-firestore' distribution doesn't get added to PyInstaller build

前端 未结 3 1884
既然无缘
既然无缘 2021-01-15 06:11

When I am trying to build an executable for my python script it gives me:

pkg_resources.DistributionNotFound: The \'google-cloud-firestore\' distribution wa         


        
3条回答
  •  囚心锁ツ
    2021-01-15 06:48

    Recently i found a solution for this,hope this will fix your problem too.

    Create two hook files:

    1. hook-google.cloud.firestore.py
    2. hook-grpc.py

    In hook-google.cloud.firestore.py write below code and save it somewhere:

    from PyInstaller.utils.hooks import copy_metadata
    datas = copy_metadata('google-cloud-firestore')
    

    In hook-grpc.py write below code and save it at same place:

    from PyInstaller.utils.hooks import collect_data_files
    datas = collect_data_files ( 'grpc' )
    

    Now copy paste both the files to :

    C:\Users\Paul\AppData\Local\Programs\Python\Python38\Lib\site-packages\PyInstaller\hooks

    If you still face the problem, Please use setuptools version 45.0.0 and then run pyinstaller and create your exe file by:

    pyinstaller --clean --onefile yourfilename.py

提交回复
热议问题