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

Some builds fail with: cannot import name 'Signature' #3734

Closed
wolph opened this issue Mar 5, 2018 · 11 comments
Closed

Some builds fail with: cannot import name 'Signature' #3734

wolph opened this issue Mar 5, 2018 · 11 comments
Labels
Support Support question

Comments

@wolph
Copy link

wolph commented Mar 5, 2018

Details

Expected Result

A successful build

Actual Result

python /home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/bin/sphinx-build -T -E -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html
Running Sphinx v1.6.5
making output directory...
loading translations [en]... done

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/lib/python3.5/site-packages/sphinx/registry.py", line 196, in load_extension
    mod = __import__(extname, None, None, ['setup'])
  File "/home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/lib/python3.5/site-packages/sphinx/ext/autodoc/__init__.py", line 34, in <module>
    from sphinx.util.inspect import Signature, isdescriptor, safe_getmembers, \
ImportError: cannot import name 'Signature'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/lib/python3.5/site-packages/sphinx/cmdline.py", line 305, in main
    opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/lib/python3.5/site-packages/sphinx/application.py", line 196, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/lib/python3.5/site-packages/sphinx/application.py", line 456, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/progressbar-2/envs/develop/lib/python3.5/site-packages/sphinx/registry.py", line 199, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname, err)
sphinx.errors.ExtensionError: Could not import extension sphinx.ext.autodoc (exception: cannot import name 'Signature')

Extension error:
Could not import extension sphinx.ext.autodoc (exception: cannot import name 'Signature')

Note that building the same project again usually succeeds as can be seen in the build log: https://readthedocs.org/projects/progressbar-2/builds/

@RichardLitt RichardLitt added the Support Support question label Mar 5, 2018
@flipdazed
Copy link

flipdazed commented Mar 6, 2018

For others, I had this issue with Sphinx-1.7.0 I upgraded to Sphinx-1.7.1 and the import issue went away but my python env suddenly crashed after reading sources ... downgrading to 1.6.9 then worked fine again

@wolph
Copy link
Author

wolph commented Mar 6, 2018

Setting the sphinx version to <1.7.0 appears to work indeed, but I'm not sure what's causing it.
Looking at the stacktrace it appears to be internal to Sphinx but I have no problems building it locally

@RichardLitt RichardLitt added Bug A bug and removed Support Support question labels Mar 7, 2018
@agjohnson
Copy link
Contributor

This looks to be something upstream with Sphinx. The exception is on an import to a Sphinx module, from a Sphinx module. I'd raise with them if the problem exists in latest Sphinx.

You can also try wiping your build environment in the case that there are old files present.

@agjohnson agjohnson added Support Support question and removed Bug A bug labels Mar 8, 2018
@wolph
Copy link
Author

wolph commented Mar 8, 2018

@agjohnson how can I wipe the build environment in RTD? I've already tried both with and without a virtualenv but that made no difference.

@ssbarnea
Copy link

Any updates on this? I don't fancy having to pin-down sphinx version just to allow RTD to succeed doing the build.

@stsewd
Copy link
Member

stsewd commented Mar 17, 2018

@wolph you need to go to versions and then to edit, there is a wipe button.

@ssbarnea did you try wiping the env? Also you can have a requirements file just for rtd.

@ssbarnea
Copy link

@stsewd Thanks! Finally after using the magic wipe button, I was able to successfully build it.

Does this also means that we could try to use newer versions of sphinx like 1.7.1 without problems on RTD?

@stsewd
Copy link
Member

stsewd commented Mar 17, 2018

Does this also means that we could try to use newer versions of sphinx like 1.7.1 without problems on RTD?

Yes, you can use the sphinx version that you need, just be aware of this Sphinx bugs #3812, #3769

@ssbarnea
Copy link

It seems that RTD triggers two builds when I push to master and one of them is failing with the Signature error. Look at https://readthedocs.org/projects/jira/builds/

If I cleanup and retrigger the build from RTD web interface it does succeed. I already spend more than half of the weekend trying to make RTF behave,... and still out of luck :(

@stsewd
Copy link
Member

stsewd commented Mar 18, 2018

@ssbarnea there are two builds probably because you have activate two versions: master and latest, but master == latest, you can deactivate master. Also I see that latest is the one version that is failing, that's because you only wipe master (rtd makes a new environment for each version, doesn't matter if they are the same commit/branch). If you wipe latest probably you will no have more problems, or I hope so :)

@agjohnson
Copy link
Contributor

Seems this is not an issue anymore. Closing.

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

6 participants