Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'translatepy.utils' (on Windows) #97

Open
shula opened this issue Dec 18, 2023 · 2 comments
Open

No module named 'translatepy.utils' (on Windows) #97

shula opened this issue Dec 18, 2023 · 2 comments

Comments

@shula
Copy link

shula commented Dec 18, 2023

I created a virtual env,
installed translatepy, with pip, from git (today, 2023-12-18)
(and then pip from pypi)

get the same error: can't find "translatepy.utils" module

#From python prompt:

>>> from translatepy import Translator
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\programs\myenv\lib\site-packages\translatepy\__init__.py", line 8, in <module>
    from translatepy.language import Language
  File "D:\programs\myenv\lib\site-packages\translatepy\language.py", line 2, in <module>
    from translatepy.utils.sanitize import remove_spaces
ModuleNotFoundError: No module named 'translatepy.utils'

#From command line:

(translatepy) D:\translatepy>dir /s/ad/b |findstr.exe util
D:\myenv\Lib\site-packages\_distutils_hack
d:\myenv\Lib\site-packages\pip\_internal\utils
D:\myenv\Lib\site-packages\pip\_internal\utils\__pycache__
[...]
D:\myenv\Lib\site-packages\urllib3\util
D:\myenv\Lib\site-packages\urllib3\util\__pycache__
D:\myenv\Lib\site-packages\_distutils_hack\__pycache__

(myenv) D:\myenv>translatepy shell
Traceback (most recent call last):
  File "D:\myenv\Scripts\translatepy-script.py", line 33, in <module>
    sys.exit(load_entry_point('translatepy==2.4', 'console_scripts', 'translatepy')())
  File "d:\myenv\Scripts\translatepy-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "C:\python\lib\importlib\metadata\__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "C:\python\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[...]
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "d:\myenv\lib\site-packages\translatepy\__init__.py", line 8, in <module>
    from translatepy.language import Language
  File "D:\myenv\lib\site-packages\translatepy\language.py", line 2, in <module>
    from translatepy.utils.sanitize import remove_spaces
ModuleNotFoundError: No module named 'translatepy.utils'

(myenv) D:\myenv>

what am I doing wrong?

@Animenosekai
Copy link
Owner

Hmm maybe try using the next branch, which is the most up to date one (beware that it introduces breaking changes)

@Animenosekai
Copy link
Owner

pip install --upgrade git+https://github.com/Animenosekai/translate@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants