0

I have an package thats imported from the parent path everywhere. So i have to set PYTHONPATH enviromentvariable when i want to serve the docs for that package.

Ive searched the Docs,stack overflow, google but couldn't find an solution to configure that in the mkdocs.yml or run an piece of python code to append it to sys.path

Edit:

  handlers:
    python:
      setup_commands:
        - import sys;sys.path.append('..');print(sys.path)

could be what i search for, but during mkdocs build (or serve) the print is never called

  • An environment variable is set in your *environment* (shell, or IDE, something like that). It will depend on the OS and on what you are using to to run mkdocs. If you specify that in your question, we may be able to help you further. – 9769953 Apr 08 '21 at 06:50
  • for that i have an solution, but i dont want that my collegues have to set an enviroment variable bevore calling mkdocs serve, so my issue is that i search an way doing this without the PYTHONPATH env – Christian U. Apr 08 '21 at 07:08

1 Answers1

0

The solution is really to use the setup_commands. Prints don't seems to be showed there and my problem was that an used package wasn't installed. The error message then is the same as when the import isn't be found.