I have absolutely no idea what can be the problem. I did the pip installer (pip install pyttsx3) and re-installed the JetBrains PyCharm, but it still not working.
Start a pyCharm terminal window, then install 'pipenv' which is an improved pip replacement as follows:
pip install -u pipenv
Then use pipenv instead of pip as this will create it's own Pipfile and virtualenv. You can install pyttsx3 as follows:
pipenv install pyttsx3
This will create a Pipfile and a Pipfile.lock which pycharm should pickup and ensure it's using the correct python version and virtualenv environment. Otherwise check that your python interpreter is set correctly in "Run/Debug configurations". If it's not in that list then you can add a new python interpreter via the Preferences->Project->Project Interpreter option.
Well i might be a little late but incase anyone is still having problem, i managed to fix it with py -m pip install pyttsx3
Here a solution on my mac with BigSur OS, maybe because i have a mixed configuration
so i try pip3 install pyttsx3 and instales but checkin in different place:
when import fails throwing an error. So i decided to go on and i found where the pip3 installed the pkgs:
check if is installed:
python3 -m pyttsx3
/Applications/Xcode.app/Contents/Developer/usr/bin/python3: No module named pyttsx3
python -m pyttsx3
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named pyttsx3
pip3 install pyttsx3
first check where is a previus version:
ls -lstr /Users/paul/Library/Python/3.7/lib/python/site-packages
...
0 drwxr-xr-x 8 paul staff 256 Mar 2 01:52 pyobjc-7.1.dist-info
0 drwxr-xr-x 9 paul staff 288 Mar 2 01:52 pyttsx3
0 drwxr-xr-x 9 paul staff 288 Mar 2 01:52 pyttsx3-2.90.dist-info
0 drwxr-xr-x 17 paul staff 544 Mar 2 02:44 urllib3
0 drwxr-xr-x 8 paul staff 256 Mar 2 02:44 urllib3-1.26.3.dist-info
0 drwxr-xr-x 9 paul staff 288 Mar 2 02:44 soupsieve
0 drwxr-xr-x 8 paul staff 256 Mar 2 02:44 soupsieve-2.2.dist-info
8 -rw-r--r-- 1 paul staff 544 Mar 2 02:44 rubicon_
...
python3 --version
Python 3.8.2
check the path of the pkg on your system with:
python -m pyttsx3
Then you just have to copy to the path where you need to use the package.
sudo cp -r /Users/paul/Library/Python/3.7/lib/python/site-packages/pyttsx3/ /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages
sudo cp -r /Users/paul/Library/Python/3.7/lib/python/site-packages/pyttsx3-2.90.dist-info /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages
regards
I had the same issue.
All I did is used 'python <filename>
' to run the program instead of 'python3 <filename>
' and it WORKED.
I am not sure, but maybe pyttsx3 does not support the python3 syntax to find itself.
I hope this helps anyone out there, who searched for hours just like me.
If you're using Python 3 then use
pip3 install pyttsx3
© 2022 - 2024 — McMap. All rights reserved.
File -> Settings -> Project:.. -> Project Interpreter
and check which version of Python you run on the project. Then go to the CMD/ terminal and writepip -V
and it will tell you the pip version and the Python one. Might be different version. – Calyptrapip -V
it should write the Python version. To upgrade pip you can usepip install --upgrade pip
. – CalyptraFile -> Settings -> Project:.. -> Project Interpreter
. Click on the arrow at "Python Interpreter". If you only have one then try to first reinstall the package usingpip install --upgrade --force-reinstall pyttsx3
. If none of these work then I suggest to try and install the package on Pycharm itself by clicking on the green plus sign at the project interpreter window. – Calyptra