Google images search API raising ModuleNotFoundError for curses on windows

45 Views Asked by At

I have been working on a project on pycharm for a couple of weeks now and one of the components of that project broke after I changed the interpreter to Python 3.11, I was using Python 3.10 before. here is the code:


from google_images_search import GoogleImagesSearch
from pathlib import Path

def image_getter(name):
    """ Searches for the image for the provided name. """
    gcs_developer_key = #your key goes here

    gcs_key = # your key goes here
    gis = GoogleImagesSearch(gcs_developer_key, gcs_key)
    _search_params = {
        'q': name,
        'num': 1,
        'fileType': 'jpg',
    }
    # getting current working directory
    cwd_path = Path().cwd()
    # joining cwd with image directory
    images_path = cwd_path.joinpath("IMAGES")

    gis.search(search_params=_search_params, path_to_dir=images_path, custom_image_name=name)

and I keep getting the error:

ModuleNotFoundError: No module named '_curses'

I have searched for answers by googling so I have tried the following:

  1. pip install windows-curses Did not work.
  2. I tried the function on a fresh project.
  3. uninstalled the package.
  4. uninstalled python 3.11 and reinstalled.
  5. deleted the venv folder in pycharm and recreated it.

All of the above tries resulted in the same error. I have tried running it on a mac and that worked just fine and going back to python 3.10 also got rid of the error. Any help would be appreciated.

0

There are 0 best solutions below