Source directory problem for notebook examples #1249

Closed
Padarn opened this Issue Dec 18, 2013 · 11 comments

Projects

None yet

4 participants

@Padarn
Contributor
Padarn commented Dec 18, 2013

I had some trouble building the docs using

make html

from the /docs directory. The problem seemed to come from the file 'tools/nbgenerate.py', which has the line

SOURCE_DIR = ("/home/skipper/statsmodels/statsmodels-skipper/examples/"
          "notebooks")

Obviously the first directory didn't exist for me, which caused an error.

Current version: 0.6.0.dev-b2c35b4

@josef-pkt
Member

Should be replaced by relative path, but I haven't set up nbconvert to test this

@Padarn
Contributor
Padarn commented Dec 23, 2013

I do have nbconvert set up, but couldn't quite figure out what the relative paths should be, so I'll leave this to someone who knows what they are doing.

@clarkfitzg

+1 Same issue here when trying to build docs.

@jseabold
Member

PR would be welcome here.

@jseabold jseabold added a commit to jseabold/statsmodels that referenced this issue Jul 29, 2014
@jseabold jseabold BLD: Don't hard-code path for building notebooks. Closes #1249 34e8fc8
@Padarn
Contributor
Padarn commented Jul 29, 2014

Will try do one later today.

@jseabold
Member

Thanks I made one already

@Padarn
Contributor
Padarn commented Jul 29, 2014

Ah okay cool.

On Wed, Jul 30, 2014 at 6:36 AM, Skipper Seabold notifications@github.com
wrote:

Thanks I made one already


Reply to this email directly or view it on GitHub
#1249 (comment)
.

@josef-pkt
Member

can any of you try the relative path in #1854 ?
I don't know if I will be able to check this.

@clarkfitzg

I'll try it today.

On Wednesday, July 30, 2014, Josef Perktold notifications@github.com
wrote:

can any of you try the relative path in #1854
#1854 ?
I don't know if I will be able to check this.


Reply to this email directly or view it on GitHub
#1249 (comment)
.

@clarkfitzg

The relative path in #1854 works for me.

I'm using Anaconda and ended up having to do $ export PYTHONPATH="/Users/clark/statsmodels before building docs since it was unable to import statsmodels.compat.

After that the docs start building until I get the following error. Not sure what it means to have all these cells with exceptions also.

~/statsmodels/docs $ make html
# generate the examples rst files
Generating reST from examples folder
#../tools/examples_rst.py
Generating notebooks from examples/notebooks folder
../tools/nbgenerate.py
Writing  categorical_interaction_plot
ran notebook
    ran   3 cells
    there were no errors in run_cell
    all code executed in the notebook as expected
/Users/clark/anaconda/lib/python2.7/site-packages/IPython/nbconvert/filters/markdown.py:78: UserWarning: Node.js 0.9.12 or later w
asn't found.
Nbconvert will try to use Pandoc instead.
  "Nbconvert will try to use Pandoc instead.")
Writing  contrasts
ran notebook
    ran  26 cells
    there were no errors in run_cell
      2 cells have exceptions in their output

...

Writing  wls
ran notebook
    ran   9 cells
    there were no errors in run_cell
      9 cells have exceptions in their output
Generating datasets from installed statsmodels.datasets
../tools/dataset_rst.py
Traceback (most recent call last):
  File "../tools/dataset_rst.py", line 8, in <module>
    import statsmodels.api as sm
  File "/Users/clark/statsmodels/statsmodels/api.py", line 16, in <module>
    from .tsa import api as tsa
  File "/Users/clark/statsmodels/statsmodels/tsa/api.py", line 1, in <module>
    from .ar_model import AR
  File "/Users/clark/statsmodels/statsmodels/tsa/ar_model.py", line 16, in <module>
    from statsmodels.tsa.kalmanf.kalmanfilter import KalmanFilter
  File "/Users/clark/statsmodels/statsmodels/tsa/kalmanf/__init__.py", line 1, in <module>
    from .kalmanfilter import KalmanFilter
  File "/Users/clark/statsmodels/statsmodels/tsa/kalmanf/kalmanfilter.py", line 33, in <module>
    from . import kalman_loglike
ImportError: cannot import name kalman_loglike
make: *** [html] Error 1
@clarkfitzg

Googled my error and came across an old thread. I hadn't built statsmodels in place yet-

~/statsmodels $ python setup.py build_ext --inplace

Builds fine now.

@jseabold jseabold closed this in 85c2e2a Aug 1, 2014
@PierreBdR PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
@jseabold jseabold BLD: Don't hard-code path for building notebooks. Closes #1249 a89430d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment