Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upImport Error if module is not defined in this environment #8
Comments
This comment has been minimized.
This comment has been minimized.
|
pdoc generates documentation by importing the module it is trying to document. This means that it must be a valid Python file that is importable in the current environment. There are no plans to change this. (It would require parsing the Python AST manually.) |
BurntSushi
closed this
May 10, 2014
This comment has been minimized.
This comment has been minimized.
ryneeverett
commented
Oct 20, 2015
Perhaps that would be prohibitively difficult but it seems like the tool would be a lot more robust if you didn't have to worry about import side-effects. For instance any django project would currently have to write a wrapper script to handle |
This comment has been minimized.
This comment has been minimized.
|
@ryneeverett No, really, it's a non-starter. I totally agree that what you're describing would be awesome, but it would literally require a ground up rewrite. This means |
This comment has been minimized.
This comment has been minimized.
|
@ryneeverett It's also probably one or two orders of magnitude harder to do. |
This comment has been minimized.
This comment has been minimized.
|
@ryneeverett On top of all of that, it's really hard (for me personally) to justify that kind of effort to work around non-idiomatic Python code (which shouldn't have nasty import side effects). |
This comment has been minimized.
This comment has been minimized.
TheCherry
commented
Nov 20, 2015
|
Have at the moment the same problem. |
pyatil commentedMay 7, 2014
test.py:
import fooooooo
Traceback (most recent call last):
File "C:\Python27\Scripts\pdoc", line 454, in
module = imp.load_source('pdoc_file_module', fp, f)
File "User\work\test.py", line 17, in
import bdf
ImportError: No module named fooooooo
My project works in an environment who constructs python module dynamically. I can't use pdoc in this environment. How can I ignore this module and continue generate docs?
Thx for the help.