health-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Health-dev] Modules path


From: Luis Falcon
Subject: Re: [Health-dev] Modules path
Date: Wed, 19 Jul 2023 23:46:47 +0100
User-agent: K-9 Mail for Android

Hi, Patrick



On July 19, 2023 6:39:08 PM GMT+01:00, "p.rosik@stud.uni-hannover.de" 
<p.rosik@stud.uni-hannover.de> wrote:
>
>Hello dear Gnu Health Community,
>
>I have another question for you guys. This one is about the Sphinx 
>documentation and especially specifying the path in the "conf.py". I am now 
>trying to generate my documentation of the modules health_imaging and 
>health_orthanc via autodoc respectively sphinx-apidoc and unfortunately the 
>error occurs:
> WARNING: autodoc: failed to import module 'x' from module 'modules'; the 
>following exception was raised: No module named 'modules'.

Check the env variable PYTHONPATH

If you use the vanilla installation, the bashrc profile has an example on how 
to use it.

Bests
Luis

>
>I have tried several things. 
>https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html 
>As a "gnuhealth" user and in the "venv" environment under 
>/opt/gnuhealth/venv/lib/.../trytond/modules --> "sphinx-apidoc -F -a -o docs . 
>" tried.
>
>Then also tried recursively adding each path from trytond to the generated 
>"conf.py":
>def add_subdirectories_to_path(directory):
>    for root, dirs, _ in os.walk(directory):
>        for d in dirs:
>            sys.path.insert(0, os.path.abspath(os.path.join(root, d)))
>
>add_subdirectories_to_path('/opt/gnuhealth/venv/lib/python3.10/site-packages/trytond/')
>
>Tried it again also to do that directly in "trytond" that pretty sure all 
>dependencies are accounted for. Is any of you maybe familiar with what the 
>path needs to look like. Believe this is the reason it is not working. The way 
>I read it, every import must be reachable.
>
>(Using sphinx-apidoc -F -a -o docs . in .../trytond/modules)
>index.rst contains:
>Welcome to modules's documentation!
>===================================
>
>.. toctree::
>   :maxdepth: 4
>   :caption: Contents:
>
>   modules
>
>modules.rst contains:
>modules package
>===============
>
>Subpackages
>------------------
>
>.. toctree::
>   :maxdepth: 4
>
>   modules.account
>   (... other modules)
>
>Module contents
>----------------------
>
>.. automodule:: modules
>   :members:
>   :undoc-members:
>   :show-inheritance:
>
>
>conf.py contains:
>import os
>import sys
>#def add_subdirectories_to_path(directory):
>#    for root, dirs, _ in os.walk(directory):
>#        for d in dirs:
>#            sys.path.insert(0, os.path.abspath(os.path.join(root, d)))
>
>#add_subdirectories_to_path('/opt/gnuhealth/venv/lib/python3.10/site-packages/trytond/')
> (tried it with and without this)
>sys.path.insert(0, 
>'/opt/gnuhealth/venv/lib/python3.10/site-packages/trytond/modules')
>
>Am grateful for any ideas.
>
>Best regards,
>Patryk

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]