Relative imports require the ‘package’ argument

I came to this question via Google, so I’ll answer what helped me (not directly related to the question). I use importlib to dynamically import sub-packages given by a string. import importlib module_name=”subpackage.i.import” special_module = importlib.import_module(module_name, package=None) This simply has to be adjusted to import importlib module_name=”subpackage.i.import” special_module = importlib.import_module(module_name, package=”my_current_pkg”)

How do I create documentation with Pydoc?

Another thing that people may find useful…make sure to leave off “.py” from your module name. For example, if you are trying to generate documentation for ‘original’ in ‘original.py‘: yourcode_dir$ pydoc -w original.py no Python documentation found for ‘original.py’ yourcode_dir$ pydoc -w original wrote original.html

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)