Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError for local module - on el Capitan #96

Open
aa403 opened this issue Feb 29, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@aa403
Copy link

commented Feb 29, 2016

I get the following error on OSX,

Traceback (most recent call last):
  File "/usr/local/bin/pdoc", line 458, in <module>
    module = imp.load_source('__pdoc_file_module__', fp, f)
  File "/project_folder/hooks/__init__.py", line 1, in <module>
    from base import *

when running this command:

pdoc hooks --all-submodules --html --overwrite --html-no-source --html-dir docs/

my directory structure is:

.
├── Procfile
├── README.md
├── __init__.py
├── docs
├── hooks
│   ├── __init__.py
│   ├── active_events.py
│   ├── base.py
│   ├── loan_template.py
├── requirements.txt
└── runtime.txt

and hooks/init.py contains

from base import *
from loan_template import *
from active_events import *

I do not get this issue on my Ubuntu machine, having just installed pdoc 0.3.1 on both, via pip.

any ideas?

@sanseihappa

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2016

Have you tried pdoc 0.3.2? Also, your traceback is missing the actual exception... what is it?

@TorbenFricke

This comment has been minimized.

Copy link

commented Sep 10, 2016

I'm having the very same issue on 0.3.2. Any ideas?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2016

Could someone please include the full traceback and code that is provoking the problem?

@TorbenFricke

This comment has been minimized.

Copy link

commented Sep 13, 2016

Here is the full traceback:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pdoc", line 4, in <module> __import__('pkg_resources').run_script('pdoc==0.3.2', 'pdoc') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 719, in run_script self.require(requires)[0].run_script(script_name, ns) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1504, in run_script exec(code, namespace, namespace) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pdoc-0.3.2-py2.7.egg/EGG-INFO/scripts/pdoc", line 472, in <module> module = imp.load_source('__pdoc_file_module__', fp, f) File "/Users/Torben/Dropbox/Uni/Masterarbeit/Audi/IALmodules/__init__.py", line 16, in <module> import utils ImportError: No module named utils

I was able to fix the issue by adding the following snipping to the beginning of "init.py":

import sys, os _path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(_path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.