0

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.

  • 1
    Did you [activate the right venv](https://docs.python.org/3/library/venv.html?highlight=activate)? From your description it seems you're not activating the right venv. – bad_coder Oct 29 '22 at 03:56
  • @bad_coder Thank you for the suggestions,I can’t get to the computer I’m working on at the moment, so I’ll have to check these solutions later. But I did check if the error was raised in a different environment other than pycharm’s. I did try just importing the google_images_search on Python IDLE as well as on CLI and that gave me the same curses error. – Mahmud Alptekin Oct 29 '22 at 10:49
  • 1
    Thank you very much for your suggestions I was able to fix the problem by checking the interpreted paths in my pycharm settings. I don't know why they were pointing to 3.10 python files in the first place but changing that to 3.11 seem to make the error go away. – Mahmud Alptekin Oct 31 '22 at 08:52

0 Answers0