Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Can I Fix "The 'google-api-python-client' distribution was not found and is required by the application" #5215

Closed
ghost opened this issue Oct 2, 2020 · 5 comments

Comments

@ghost
Copy link

ghost commented Oct 2, 2020

I get an error while trying to package an app using tensorflow: pkg_resources.DistributionNotFound: The 'google-api-python-client' distribution was not found and is required by the application

I ran pyinstaller {filename}.py which had import tensorflow

@rokm
Copy link
Member

rokm commented Oct 2, 2020

Looks like google-api-python-client is being pulled in because it's imported in some part of tensorflow (which you may or may not be actually using).

If you're not using google-api-python-client, try removing it from your environment (or build your program using a clean virtual environment with only required packages installed). Or try downgrading it to 1.8.0, as per googleapis/google-api-python-client#876.

@bwoodsend
Copy link
Member

bwoodsend commented Oct 2, 2020

pkg_resources.DistributionNotFound: name in PyInstaller translates to you need to use datas=copy_metadata("name"). See this nabble thread which does exactly the same thing for pycountry.

@ghost
Copy link
Author

ghost commented Oct 2, 2020

pkg_resources.DistributionNotFound: name in PyInstaller translates to you need to use datas=copy_metadata("name"). See this nabble thread which does exactly the same thing for pycountry.

it works, but now i get Traceback (most recent call last): File "resonance.py", line 6, in <module> from magenta.models.performance_rnn import performance_sequence_generator File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "magenta/__init__.py", line 25, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "magenta/pipelines/drum_pipelines.py", line 19, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "note_seq/__init__.py", line 20, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "note_seq/audio_io.py", line 21, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "librosa/__init__.py", line 14, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "librosa/decompose.py", line 19, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "sklearn/decomposition/__init__.py", line 17, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "sklearn/decomposition/dict_learning.py", line 5, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "sklearn/decomposition/_dict_learning.py", line 21, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "sklearn/linear_model/__init__.py", line 11, in <module> File "/home/gitpod/.pyenv/versions/3.8.6/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module exec(bytecode, module.__dict__) File "sklearn/linear_model/_least_angle.py", line 23, in <module> File "sklearn/utils/arrayfuncs.pyx", line 1, in init sklearn.utils.arrayfuncs ModuleNotFoundError: No module named 'sklearn.utils._cython_blas' [16010] Failed to execute script resonance

@rokm
Copy link
Member

rokm commented Oct 2, 2020

Add sklearn.utils._cython_blas to hiddenimports in your spec file. (Or use --hidden-import sklearn.utils._cython_blas if you're directly building from .py file).

@ghost
Copy link
Author

ghost commented Oct 2, 2020

It took some time to do that but finally it works! Thank you both!

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants