Like pyttsx3 is a module which can be put in any python application.
To install python libraries in Google Project IDX, you can open a new terminal in IDX and execute the pip command followed by the library name.
Eg. If you want to install the pyttsx3 library in IDX, you can execute the following command in IDX terminal:
pip install pyttsx3
Do try this and let us know. If you still face any issue. Please feel free to get back to us.