0

I recently got my new Macbook Pro and installed 3.8.6 with pyenv and created a virtualenv for my project. When I try to run the tests for this project i get the following error about a module not found by a dependency (abridged). The the files are all there, ad_manager is a file right next to the __init__.py file that is importing it. This was not a problem on my old machine.

echo $PYTHONPATH is empty

python -c 'import sys; print(sys.path)' -> ['', '/Users/derek/.pyenv/versions/3.8.6/lib/python38.zip', '/Users/derek/.pyenv/versions/3.8.6/lib/python3.8', '/Users/derek/.pyenv/versions/3.8.6/lib/python3.8/lib-dynload', '/Users/derek/.pyenv/versions/VIRTUAL_ENV_3.8.6/lib/python3.8/site-packages']

Traceback (most recent call last):
  File "/Users/derek/dev/PATH_TO_PROJECT/tests/../src/services/adwords_service.py", line 18, in <module>
    from googleads import oauth2, adwords
  File "/Users/derek/.pyenv/versions/VIRTUAL_ENV_3.8.6/lib/python3.8/site-packages/googleads/__init__.py", line 17, in <module>
    from ad_manager import AdManagerClient
ModuleNotFoundError: No module named 'ad_manager'
MattDMo
  • 100,794
  • 21
  • 241
  • 231
doman412
  • 191
  • 11
  • What version of `googleads` do you have installed? The [current version of `__init__.py` on Github](https://github.com/googleads/googleads-python-lib/blob/master/googleads/__init__.py#L17) has `from .ad_manager import AdManagerClient`, not `from ad_manager import AdManagerClient`. That `.` makes a big difference. – MattDMo Nov 20 '21 at 01:32
  • `17.0.0` which is pinned for the project. I did modify that file and add `.` but it only pushed the issue to the next module import. I could try to upgrade to another version but not sure if that will break things for the project. – doman412 Nov 20 '21 at 01:42
  • Change the next line to `from .adwords import AdWordsClient`. Does that fix it? – MattDMo Nov 20 '21 at 01:45
  • I mean imports within the ad_manager module. I'm suddenly having internet issues so I can't test v18.0.0, will get back to you when I can – doman412 Nov 20 '21 at 02:00
  • did you solve it? – Fernando Santiago Jul 15 '22 at 12:34

0 Answers0