Search code examples
pythonanacondacondaspydergoogle-ads-api

Unable to install the googleads module for python in anaconda (Spyder)


I am trying to use the python googleads module in a script on Spyder.

I have run pip install googleads and the installation has succeeded.

However, when I try to import googleads in the script on Spyder, it gives me the below error:

ModuleNotFoundError: No module named 'googleads'

I have uninstalled the package and run pip install googleads again. The installation succeeds this time as well but the above error persists.

I have tried using conda install as well. That does not install the package.

However, when I run the script on the command prompt, it works fine. The issue is only with Spyder.

I have also Googled and looked up StackOverflow and most other communities for a solution to this but haven't been able to find one :(

Looking forward to some help here, to fix the issue.

Thank you in advance!

PS: I have run the pip install on the Anaconda prompt as well and that succeeds too. The error on Spyder still exists.


Solution

  • So I hired a freelancer with considerable experience in Anaconda and Spyder to help me fix this issue. Sharing the solution here for the benefit of everyone else.

    There was an issue with the installation of pip in the environment I was working in. This is how we found and fixed the issue:

    On the Anaconda prompt, we used the command conda list and checked if pip was installed. It was.

    We then typed the command where pip and received the response below: C:\Users\Rohit\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe

    We then created a new test environment in anaconda, navigated to it and ran the same where pip command. It returned the below response: C:\Users\Rohit\Anaconda3\Scripts\pip.exe C:\Users\Rohit\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe

    We figured that there was an issue with the pip installation on the environment, which is why it was installing the packages on the global environment and not the project environment.

    We then re-installed pip on the project environment using the conda install and re-ran the where pip command. It now returned the below response: C:\Users\Rohit\Anaconda3\Scripts\pip.exe C:\Users\Rohit\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe

    After this, we installed the package using pip install googleads and then ran import googleads in Spyder. It worked perfectly fine.

    Works fine now with all the other project packages.