Unable to install pyttsx3 module in Python

For some reason, I am unable to install the pyttsx3 module in Python. I always get the error. I am new to programming and to python, so please help by giving simple answers, so that even I can understand them.

PS C:\Users\laxmi> pip install pyttsx3
Collecting pyttsx3
  Using cached pyttsx3-2.84-py3-none-any.whl (39 kB)
Collecting pyobjc>=2.4
  Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB)
Collecting comtypes; "win32" in sys_platform
  Using cached comtypes-1.1.7.zip (180 kB)
Collecting pyobjc-framework-SyncServices==6.1
  Downloading pyobjc-framework-SyncServices-6.1.tar.gz (42 kB)
     |████████████████████████████████| 42 kB 55 kB/s 
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files (x86)\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\laxmi\\AppData\\Local\\Temp\\pip-install-8oeeuvox\\pyobjc-framework-SyncServices\\setup.py'"'"'; __file__='"'"'C:\\Users\\laxmi\\AppData\\Local\\Temp\\pip-install-8oeeuvox\\pyobjc-framework-SyncServices\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\laxmi\AppData\Local\Temp\pip-install-8oeeuvox\pyobjc-framework-SyncServices\pip-egg-info'       
         cwd: C:\Users\laxmi\AppData\Local\Temp\pip-install-8oeeuvox\pyobjc-framework-SyncServices\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-8oeeuvox\pyobjc-framework-SyncServices\setup.py", line 25, in <module        Extension(
 Extension
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-8oeeuvox\pyobjc-framework-SyncServices\pyobjc_setup.py", line 218, in get_os_level
        pl = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist")
      File "c:\program files (x86)\python38-32\lib\plistlib.py", line 99, in readPlist
        with _maybe_open(pathOrFile, 'rb') as fp:
      File "c:\program files (x86)\python38-32\lib\contextlib.py", line 113, in __enter__
        return next(self.gen)
      File "c:\program files (x86)\python38-32\lib\plistlib.py", line 82, in _maybe_open
        with open(pathOrFile, mode) as fp:
    FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Please update setup tools pip install -U setuptools

thanks, but I have already tried it. It is already up to date -

PS C:\Users\laxmi> pip install -U setuptools
Requirement already up-to-date: setuptools in c:\program files (x86)\python38-32\lib\site-packages (46.0.0)
PS C:\Users\laxmi>

hey, @KittyKora. I wanted to ask, can we install the pyttsx3 module without needing pip?

Hello there.

Have you read the documentation for installation?

hi, @Sky020. Yes, I have. But I am still unable to install it.

PS C:\Users\laxmi> pip install pyttsx3
Collecting pyttsx3
  Using cached pyttsx3-2.84-py3-none-any.whl (39 kB)
Collecting comtypes; "win32" in sys_platform
  Using cached comtypes-1.1.7.zip (180 kB)
Collecting pyobjc>=2.4
  Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB)
Collecting pyobjc-framework-Message==6.1; platform_release < "13.0"
  Using cached pyobjc_framework_Message-6.1-py2.py3-none-any.whl (3.9 kB)
Collecting pyobjc-framework-CoreData==6.1
  Using cached pyobjc-framework-CoreData-6.1.tar.gz (157 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files (x86)\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\laxmi\\AppData\\Local\\Temp\\pip-install-vhkvrszf\\pyobjc-framework-CoreData\\setup.py'"'"'; __file__='"'"'C:\\Users\\laxmi\\AppData\\Local\\Temp\\pip-install-vhkvrszf\\pyobjc-framework-CoreData\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\laxmi\AppData\Local\Temp\pip-install-vhkvrszf\pyobjc-framework-CoreData\pip-egg-info'
         cwd: C:\Users\laxmi\AppData\Local\Temp\pip-install-vhkvrszf\pyobjc-framework-CoreData\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-vhkvrszf\pyobjc-framework-CoreData\setup.py", line 21, in <module>   
        Extension(
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-vhkvrszf\pyobjc-framework-CoreData\pyobjc_setup.py", line 408, in Extension
        os_level = get_os_level()
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-vhkvrszf\pyobjc-framework-CoreData\pyobjc_setup.py", line 218, in get_os_level
        pl = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist")
      File "c:\program files (x86)\python38-32\lib\plistlib.py", line 99, in readPlist
        with _maybe_open(pathOrFile, 'rb') as fp:
      File "c:\program files (x86)\python38-32\lib\contextlib.py", line 113, in __enter__
        return next(self.gen)
      File "c:\program files (x86)\python38-32\lib\plistlib.py", line 82, in _maybe_open
        with open(pathOrFile, mode) as fp:
    FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
PS C:\Users\laxmi>

If you have done this: pip i pypiwin32
Then, here are some options:

pip install git+https://github.com/nateshmbhat/pyttsx3

Or, as an annoying final resort:

  1. Uninstall Python 3.8.
  2. Install Python 3.6 (Reportedly, you could get by with 2.71, but I dislike Python 2)

Depending on how much time you want to spend on this:

  1. Do not uninstall 3.8, but install 3.6 as well, and point to it in your project folder as the version to use: Multiple Versions of Python on Windows
  2. Use an online Python Editor to make and test your project: https://repl.it/languages/python3

Hope this helps

Yes here’s how to:

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.

–Lingster

No, @Sky020, It doesn’t. Even when I installed python 3.6, it didn’t work.

Do you get the same error message?

How about this

pip install git+https://github.com/nateshmbhat/pyttsx3

from here? This is installing direct from the official project repositiory on GitHub.

I have a lot of success when I copy and past exact lines from error messages into Google - usually someone else has had my problem at some point. In this case I Googled

    FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'

No, @JeremyLT it did not work. I am just a beginner, so I do not understand all the things in the net. I wanted to ask, is there any code compiler that allows the use of modules without installing them? Or any other solution? Please reply.

Yes, @Sky020. I get the same error-

PS C:\Users\laxmi> pip install pyttsx3
Collecting pyttsx3
  Using cached pyttsx3-2.84-py3-none-any.whl (39 kB)
Collecting pyobjc>=2.4
  Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB)
Collecting comtypes; "win32" in sys_platform
  Using cached comtypes-1.1.7.zip (180 kB)
Collecting pyobjc-framework-CoreData==6.1
  Using cached pyobjc-framework-CoreData-6.1.tar.gz (157 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\laxmi\appdata\local\programs\python\python36\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\laxmi\\AppData\\Local\\Temp\\pip-install-epvkjqip\\pyobjc-framework-CoreData\\setup.py'"'"'; __file__='"'"'C:\\Users\\laxmi\\AppData\\Local\\Temp\\pip-install-epvkjqip\\pyobjc-framework-CoreData\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\laxmi\AppData\Local\Temp\pip-install-epvkjqip\pyobjc-framework-CoreData\pip-egg-info'
         cwd: C:\Users\laxmi\AppData\Local\Temp\pip-install-epvkjqip\pyobjc-framework-CoreData\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-epvkjqip\pyobjc-framework-CoreData\setup.py", line 27, in <module>
        for fn in os.listdir("Modules")
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-epvkjqip\pyobjc-framework-CoreData\pyobjc_setup.py", line 408, in Extension
        os_level = get_os_level()
      File "C:\Users\laxmi\AppData\Local\Temp\pip-install-epvkjqip\pyobjc-framework-CoreData\pyobjc_setup.py", line 218, in get_os_level
        pl = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist")
      File "c:\users\laxmi\appdata\local\programs\python\python36\lib\plistlib.py", line 162, in readPlist
        with _maybe_open(pathOrFile, 'rb') as fp:
      File "c:\users\laxmi\appdata\local\programs\python\python36\lib\contextlib.py", line 81, in __enter__
        return next(self.gen)
      File "c:\users\laxmi\appdata\local\programs\python\python36\lib\plistlib.py", line 120, in _maybe_open
        with open(pathOrFile, mode) as fp:
    FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
PS C:\Use

Can I paste the file from another computer?

Is your project too complex for this? It just seems like the most likely to work method, now.

I started out struggling to understand results I Googled when I fist started coding, but it’s always worth trying. Googling technical questions is a skill, like coding.

Did you get the same error again with downloading directly from GitHub or a different error? Getting a different error is actually progress.

As @Sky020 said, the only way to run Python modules without installing them is to use an online environment such as repl.it. This won’t work for more complex projects.

@JeremyLT, Yes, I get the same error. And for some reason, the repel.it editor shows the error :-


Repl.it: Updating package configuration

--> /usr/local/bin/python3 -m poetry add pyttsx3
Using version ^2.84 for pyttsx3

Updating dependencies
Resolving dependencies...

Writing lock file


Package operations: 36 installs, 0 updates, 0 removals

  - Installing pyobjc-core (6.1)

[EnvCommandError]
Command ['/home/runner/.local/share/virtualenvs/python3/bin/python', '-m', '
pip', 'install', '--no-deps', 'pyobjc-core==6.1'] errored withthe following
 output:
Collecting pyobjc-core==6.1
  Using cached https://files.pythonhosted.org/packages/3a/80/0cdb2130b86a984
e4765beb93135aa9c2120fd64be1a27e1c7cb31c719bc/pyobjc-core-6.1.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /home/runner/.local/share/virtualenvs/python3/bin/python -c 'i
mport sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cxwuy_3
5/pyobjc-core/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cxwuy_35/pyobjc-
core/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=
f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-cxwuy_35/pyobjc-core/
    Complete output (2 lines):
    running egg_info
    error: PyObjC requires macOS to build
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.pyegg_info Chec
k the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is availab
le.
You should consider upgrading via the 'pip install --upgrade pip' command.

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

exit status 1


Repl.it: Package operation failed.


I do not really understand the error.

No, @Sky020, I am just trying to learn the pyttsx3, as a friend of mine told me that it is the best text-to-speech module there is. I do plan on more complex projects soon, though. The thing is, the online editor shows :-


Repl.it: Updating package configuration

--> /usr/local/bin/python3 -m poetry add pyttsx3
Using version ^2.84 for pyttsx3

Updating dependencies
Resolving dependencies...

Writing lock file


Package operations: 36 installs, 0 updates, 0 removals

  - Installing pyobjc-core (6.1)

[EnvCommandError]
Command ['/home/runner/.local/share/virtualenvs/python3/bin/python', '-m', '
pip', 'install', '--no-deps', 'pyobjc-core==6.1'] errored withthe following
 output:
Collecting pyobjc-core==6.1
  Using cached https://files.pythonhosted.org/packages/3a/80/0cdb2130b86a984
e4765beb93135aa9c2120fd64be1a27e1c7cb31c719bc/pyobjc-core-6.1.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /home/runner/.local/share/virtualenvs/python3/bin/python -c 'i
mport sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cxwuy_3
5/pyobjc-core/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cxwuy_35/pyobjc-
core/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=
f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-cxwuy_35/pyobjc-core/
    Complete output (2 lines):
    running egg_info
    error: PyObjC requires macOS to build
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.pyegg_info Chec
k the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is availab
le.
You should consider upgrading via the 'pip install --upgrade pip' command.

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

exit status 1


Repl.it: Package operation failed.


Like I have said before, I am just a beginner, so I do not really know what to do.

I am sorry I could not be of more help. My final suggestion is to try this:

Hope you find a way around the issue.

1 Like

If that doesn’t work, you can ask for help by creating an issue on their GitHub.

It worked when I used

pip install -U pyttsx3==2.71

Thanks, @Sky020, @JeremyLT, @KittyKora, for your help. Googling technical questions really is a skill.