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.
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.
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.
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
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.
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.