Open almehady opened 3 years ago
День добрый
В приложении надо исправить строку:
if not isfile(path.join(temp_path, ext_file.file_name)):
на
if not path.isfile(path.join(temp_path, ext_file.file_name)):
иначе получаем ошибку "Exception name 'isfile' is not defined"
Hello, having the same problem . Pls give a proper solution on how to fix it. I rlly want to use it since i think its a great package.
Thx in advance for any help OmegaHawkeye
Файл для правки лежит здесь : venv/lib/python3.6/site-packages/gTTS/templatetags/gTTS.py
В нем надо исправить строку:
if not isfile(path.join(temp_path, ext_file.file_name)):
на
if not path.isfile(path.join(temp_path, ext_file.file_name)):
Обратиться к методу isfile
через импортируемый path
(из строки выше from os import path, makedirs, remove
) библиотеки os
I already did that but as soon as I add 'gTTS' to installed apps or to the urls it throws an error like this:
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'gTTS'
I researched and it might be bc the File is named like the module 'gTTS' u r using.
Would be great if u get that fixed. Thx in advance, OmegaHawkeye
I fixed it with editing some source in your env/Lib/site-packages/gtts/init.py add this code
from .version import __version__
from .tts import gTTS, gTTSError
__all__ = ["__version__", "gTTS", "gTTSError"]
and in settings.py you need change gTTS to gtts and same for urls this work for me
i just wanted to use template tag {% say %} and this changes make it happend
Hello Dev,
thanks for making djagno gtts app. I'm trying to integrate with my django project (following your instruction) but getting the following error:
FYI - I'm already using gTTS app with my project and it's working fine.
Your suggestion will be highly appreciated.
Happy coding.
thanks. AM.