ModuleNotFoundError: No module named 'google' on python 3.6.7

前端 未结 2 1295
执笔经年
执笔经年 2021-01-27 03:08

I\'m making a script that receives some args and use these args to manipulate a Firebase Realtime Database.

When I run the script on cmd (I\'m on a Windows 10 computer)

相关标签:
2条回答
  • 2021-01-27 03:30

    I solved it by changing the python version to 3.7.2 and using pyinstaller (wich I've tried before and also didn't worked) instead of cx_freeze.

    Don't know why, but its working now.

    0 讨论(0)
  • 2021-01-27 03:50

    EDIT: try to modify your setup.py as follows:

    import sys
    from cx_Freeze import setup, Executable
    
    include_files = []
    packages = ['google']
    build_exe_options = {'include_files': include_files,
                         'packages': packages}
    
    setup ( 
        name = "pyFirebase",
        version = "1.1",
        options = {'build_exe': build_exe_options},
        executables = [Executable("pyFirebase.py")]
    )
    

    google uses requests, you'll find additional information on how to use requests with cx_Freeze in Requests library: missing SSL handshake certificates file after cx_Freeze.

    You might further need to add any necessary file (license file, certificate, ...?) to the include_files list.

    As far as the Missing modules list reported by cx_Freeze is concerned, this is not necessarily a problem.

    0 讨论(0)
提交回复
热议问题