Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
install the gTTS
#1
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
Reply
#2
(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'
Reply
#3
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.
>>>
Reply
#4
Now you are using Python 3.8,so set the path to that interpreter in Pycharm.
Configure a Python interpreter
Reply
#5
Many thanks it is working now
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020