Skip to content

Extension error: Could not import extension javasphinx (exception: cannot import name 'l_' from 'sphinx.locale' #7649

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

Closed
Orghaniian opened this issue Nov 6, 2020 · 3 comments
Labels
Support Support question

Comments

@Orghaniian
Copy link

Details

Expected Result

Successful build

Actual Result

build failed

python /home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/bin/sphinx-build -T -E -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html

Running Sphinx v3.3.0
loading translations [en]... done

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 416, in load_extension
    mod = import_module(extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/javasphinx/__init__.py", line 17, in <module>
    from .domain import JavaDomain
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/javasphinx/domain.py", line 25, in <module>
    from sphinx.locale import l_, _
ImportError: cannot import name 'l_' from 'sphinx.locale' (/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/locale/__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 245, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 402, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 420, in load_extension
    err) from err
sphinx.errors.ExtensionError: Could not import extension javasphinx (exception: cannot import name 'l_' from 'sphinx.locale' (/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/locale/__init__.py))

Extension error:
Could not import extension javasphinx (exception: cannot import name 'l_' from 'sphinx.locale' (/home/docs/checkouts/readthedocs.org/user_builds/poo-tp-tp1/envs/latest/lib/python3.7/site-packages/sphinx/locale/__init__.py))

I have the same error if I try on my computer

@humitos
Copy link
Member

humitos commented Nov 9, 2020

Hi @Orghaniian!

I don't think this error is related to Read the Docs but a misconfiguration with dependencies.

I have the same error if I try on my computer

You should check that the extension is compatible with the version of Sphinx you are using.

@humitos humitos added the Support Support question label Nov 9, 2020
@swaldhoer
Copy link

Maybe also related to #7663?

@stsewd
Copy link
Member

stsewd commented Nov 16, 2020

Here the user was able to reproduce the issue locally, so looks like the sphinx version is the problem here. @swaldhoer you can check if you are using the same sphinx version locally to see if you are able to reproduce this outside rtd.

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

No branches or pull requests

4 participants