Python Forum
install the gTTS - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: install the gTTS (/thread-27211.html)



install the gTTS - yasser - May-29-2020

Hello

I am trying to install gTTs from pycharm but i have the below error:

pip install gTTS

Error

python -m pip install gtts
^
SyntaxError: invalid syntax


RE: install the gTTS - snippsat - May-29-2020

(May-29-2020, 05:39 PM)yasser Wrote: python -m pip install gtts
^
SyntaxError: invalid syntax
Now are you trying to run this from interactive shell(>>>).

Do it from command line cmd(Window) or Terminal(Linux).
Even if PyCharm has build install with pip stuff,so learn to use command line for this first.
# Test pip
(del_env) E:\div_code\del_env
λ pip -V
pip 20.0.2 e:\div_code\del_env\lib\site-packages\pip (python 3.7)

# Install
(del_env) E:\div_code\del_env
λ pip install gtts
Collecting gtts
  Downloading .....
Successfully installed certifi-2020.4.5.1 chardet-3.0.4 gtts-2.1.1
gtts-token-1.1.3 idna-2.9 requests-2.23.0 urllib3-1.25.9

# Test that it work
(del_env) E:\div_code\del_env
λ ptpython
>>> import gtts
>>>
>>> print(gtts.gTTS.__doc__[1:90])
TTS -- Google Text-to-Speech.

    An interface to Google Translate's Text-to-Speech API.

>>> gtts.__version__
'2.1.1'



RE: install the gTTS - yasser - May-30-2020

Hello

All the above steps working perfectly but still from pycharm the same.

Are there any extra steps to solve pycharm issue?


Quote:C:\Windows\system32>python
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtts
>>> print(gtts.gTTS.__doc__[1:90])
TTS -- Google Text-to-Speech.

An interface to Google Translate's Text-to-Speech API.
>>>



RE: install the gTTS - snippsat - May-30-2020

Now you are using Python 3.8,so set the path to that interpreter in Pycharm.
Configure a Python interpreter


RE: install the gTTS - yasser - May-30-2020

Many thanks it is working now