0

I am using Sphinx to document a web-scraping project I am working on with Python 3.9. As part of the process I read an API key in from a yaml file. The code works fine when I test it; however, when I try to document the code with sphinx I get an error telling me that autodoc cannot import yaml because it does not recognize it. How do I fix this?

mzjn
  • 48,958
  • 13
  • 128
  • 248
Jon
  • 1,621
  • 5
  • 23
  • 46
  • Do you use different `python` instances when you run the code and when you run Sphinx? Do you use a virtualenv in one case but not the other? Have you tried `autodoc_mock_imports = ["yaml"]`? (see https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports) – mzjn Mar 12 '21 at 06:52
  • How do you "document the code with sphinx"? What is the exact error message? Please update your question with this information. – Steve Piercy Mar 12 '21 at 12:24

0 Answers0