0

I'm getting this traceback:

Traceback (most recent call last):
  File "C:\Users\svp12\PycharmProjects\practiques\main.py", line 6, in <module>
    from deep_translator import GoogleTranslator
ModuleNotFoundError: No module named 'deep_translator'

But the module is installed

enter image description here

  • have you tried running it from terminal, as shown in the docs: https://deep-translator.readthedocs.io/en/latest/README.html#quick-start like this: `deep-translator translate -src "en" -tgt "de" -txt "some text to translate"` ? – 35308 Jul 11 '22 at 09:46
  • @35308 gives me this error: C:\WINDOWS\system32>deep-translator translate -src "en" -tgt "de" -txt "tests.txt" usage: dt --help deep-translator: error: unrecognized arguments: translate -tgt de But I need to do it from python becouse I have to translate lots of documents – Questioneer Jul 11 '22 at 09:53
  • it seems like it can run through terminal but not through python, do you use a virtual environment for python (conda...) if not here are some potential fixes https://stackoverflow.com/questions/14295680/unable-to-import-a-module-that-is-definitely-installed it could be a python path problem – 35308 Jul 11 '22 at 10:06

1 Answers1

0

Looks like you have not installed the package into the project's virtual environment. Try activating the project's venv as below and install the package:

{project_dir}/venv/Scripts/activate
pip install deep_translator
Anwar Husain
  • 1,414
  • 14
  • 19