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

failing to build the docs: issue with io.BufferedIOBase #1116

Closed
salma1601 opened this Issue Sep 7, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@salma1601

salma1601 commented Sep 7, 2016

Hi dipy people,

Thanks for sharing such a great tool ! I am new to dipy and diffusion analysis, so I cloned the repo and succeded in running the first examples. However I am failing to build the docs with the make html command executed in the doc folder. Here is the full traceback

Traceback (most recent call last):
File "tools/build_modref_templates.py", line 78, in
docwriter.write_api_docs(outdir)
File "/home/salma/CODE/diffusion/dipy/doc/tools/apigen.py", line 473, in write_api_docs
self.write_modules_api(modules, outdir)
File "/home/salma/CODE/diffusion/dipy/doc/tools/apigen.py", line 437, in write_modules_api
head, body = self.generate_api_doc(m)
File "/home/salma/CODE/diffusion/dipy/doc/tools/apigen.py", line 276, in generate_api_doc
functions, classes = self._parse_module_with_import(uri)
File "/home/salma/CODE/diffusion/dipy/doc/tools/apigen.py", line 212, in _parse_module_with_import
mod = import_module(uri)
File "/home/salma/anaconda2/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/salma/CODE/diffusion/dipy/dipy/align/imaffine.py", line 55, in
from dipy.align.imwarp import (get_direction_and_spacings, ScaleSpace)
File "/home/salma/CODE/diffusion/dipy/dipy/align/imwarp.py", line 9, in
import nibabel as nib
File "/home/salma/anaconda2/lib/python2.7/site-packages/nibabel/init.py", line 38, in
from . import analyze as ana
File "/home/salma/anaconda2/lib/python2.7/site-packages/nibabel/analyze.py", line 87, in
from .volumeutils import (native_code, swapped_code, make_dt_codes,
File "/home/salma/anaconda2/lib/python2.7/site-packages/nibabel/volumeutils.py", line 14, in
import gzip
File "/home/salma/anaconda2/lib/python2.7/gzip.py", line 36, in
class GzipFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'
Makefile:38 : la recette pour la cible « api » a échouée
make: *** [api] Erreur 1

@jchoude

This comment has been minimized.

Contributor

jchoude commented Sep 7, 2016

This sometimes happen if your $PYTHONPATH is messed up, for example if something defines an io module before the system one.

Have a look at your $PYTHONPATH by doing:

echo $PYTHONPATH

and make sure nothing suspicious is present.

@salma1601

This comment has been minimized.

salma1601 commented Sep 7, 2016

You are right ! I had some misfortunate manipulations with vtk and added it to my .bashrc $PYTHONPATH.
Removing it solved the problem and building is well in place.

Thanks !

@jchoude

This comment has been minimized.

Contributor

jchoude commented Sep 7, 2016

Good! Happy that your issue is solved!

@jchoude jchoude closed this Sep 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment