- The first one we come across in many cases should be:
pkg_resources.DistributionNotFound: The [distribution name] distribution was not found
where[distribution name]is among $\{$google-*-core,google-cloud-*$\}$ for various possible*. The first strategy is reinstallation. To somebody reinstalling the package in trouble will do. To me, I completely reinstall Python from 3.8 to just 3.7.5.
And in order to keep projects' dependency separate enough, the first package I download ispipenvand installation of the second first package is done in pipenv shell. No module named [sth], to me[sth]'s are respectively google and then google.cloud. I have tried to edit.specto include these packages ashiddenimportsthenpyinstaller xxx.spec.
If problem persists, try topip show [missing package]to get the location of problematic package, then add this location topathex.In my case reinstalling Python gets rid of all the problems in this bullet point.-
After reinstallation, we have a very clean environment, the only problem left to me is again the
google-cloud-vision, which is solved by addinghook-google.cloud.pythe followingdata += copy_metadata('google-cloud-vision') - After we get through all the trouble and successfully build an executable file, we may next encounter :
Error: Exception in 'grpc._cython.cygrpc.ssl ............ pem_root_certs != nullptr
To this we create ahook-grpc.pyand type the following:from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('grpc')
Sunday, November 24, 2019
Pyinstaller --- executable file with Google API --- obstacles I have:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment