EEG-ExPy icon indicating copy to clipboard operation
EEG-ExPy copied to clipboard

error downloading cueing data during doc build

Open kylemath opened this issue 5 years ago • 14 comments

Traceback (most recent call last): File "/Users/kylemathewson/eeg-notebooks/venv/lib/python3.7/site-packages/sphinx_gallery/gen_gallery.py", line 159, in call_memory return 0., func() File "/Users/kylemathewson/eeg-notebooks/venv/lib/python3.7/site-packages/sphinx_gallery/gen_rst.py", line 466, in call exec(self.code, self.fake_main.dict) File "/Users/kylemathewson/eeg-notebooks/examples/visual_cueing/02r__cueing_group_analysis.py", line 38, in datasets.fetch_dataset(data_dir=eegnb_data_path, experiment='visual-cueing', site='kylemathlab_dev') File "/Users/kylemathewson/eeg-notebooks/eegnb/datasets/datasets.py", line 85, in fetch_dataset with zipfile.ZipFile(destination, 'r') as zip_ref: File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/zipfile.py", line 1258, in init self._RealGetContents() File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/zipfile.py", line 1325, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

kylemath avatar Aug 25 '20 04:08 kylemath

Let's try to debug this dataset fetcher thing outside of the doc build.

  1. Retry on command line
datasets.fetch_dataset(data_dir=sometestfolderpath, experiment='visual-cueing', site='kylemathlab_dev')
  1. Is the dataset fetcher working ok for the other datasets?

JohnGriffiths avatar Aug 25 '20 11:08 JohnGriffiths

Is this okay to close with the PR merge?

JadinTredup avatar Aug 26 '20 23:08 JadinTredup

I'm also getting this error now - seems the new dataset fetcher is not working with the cueing experiment dataset. Probably because of the zip file size.

JohnGriffiths avatar Aug 27 '20 03:08 JohnGriffiths

Changed the dataset fetcher to use the gdown package, - https://github.com/NeuroTechX/eeg-notebooks/commit/f11fa0c86aead8122225295846d6f141cd707f22

this seems to have no problem with large file downloads. It's also about 1% the number of lines :) ...but an additional dependency :(

@kylemath - try the dataset fetcher commands above now.

JohnGriffiths avatar Aug 27 '20 05:08 JohnGriffiths

Thats interesting, I tried it earlier and it worked fine.

JadinTredup avatar Aug 27 '20 06:08 JadinTredup

one liner above didn't run, must need to import some things first, so I tried to remake the html docs

I pulled your change from upstream repo, merged into my branch, pip install gdown, I also added gdown to the requirements-docs.txt, then try to make the htmls and get:

Traceback (most recent call last): File "/Users/kylemathewson/eeg-notebooks/venv/lib/python3.7/site-packages/sphinx_gallery/gen_gallery.py", line 159, in call_memory return 0., func() File "/Users/kylemathewson/eeg-notebooks/venv/lib/python3.7/site-packages/sphinx_gallery/gen_rst.py", line 466, in call exec(self.code, self.fake_main.dict) File "/Users/kylemathewson/eeg-notebooks/examples/visual_cueing/01r__cueing_singlesub_analysis.py", line 30, in from eegnb.datasets import fetch_dataset File "/Users/kylemathewson/eeg-notebooks/eegnb/datasets/init.py", line 2, in from .datasets import fetch_dataset File "/Users/kylemathewson/eeg-notebooks/eegnb/datasets/datasets.py", line 5, in import gdown ModuleNotFoundError: No module named 'gdown'

kylemath avatar Aug 27 '20 06:08 kylemath

So what do you get on the command line with just

ipython
import gdown

?

JohnGriffiths avatar Aug 27 '20 07:08 JohnGriffiths

import gdown works when I :

cd eeg-notebooks source venv/bin/activate python

import gdown

On Thu, Aug 27, 2020 at 1:09 AM John Griffiths [email protected] wrote:

So what do you get on the command line with just

ipython

import gdown

?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NeuroTechX/eeg-notebooks/issues/7#issuecomment-681659489, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA36GFOCUHUVUYWJTRXBVL3SCYBDDANCNFSM4QKGJAIA .

-- Kyle E. Mathewson, Ph.D. Assistant Professor - Department of Psychology, Faculty of Science Director - Attention Perception and Performance Lab Affiliate - Neuroscience and Mental Health Institute, Faculty of Medicine and Dentistry University of Alberta P455 - Biological Sciences Building 11455 Saskatchewan Dr. Edmonton, Alberta, Canada, T6G 2E9 Phone: 1-780-492-2662 Email: [email protected] Web: www.kylemathewson.com

kylemath avatar Aug 27 '20 07:08 kylemath

So was it looking for a different python installation when you were building before?

Does this work now?

source venv/bin/activate
cd doc
make html

JohnGriffiths avatar Aug 27 '20 07:08 JohnGriffiths

yeah it works, but that is what produces the error in the html that gdown was not available

On Thu, Aug 27, 2020 at 1:14 AM John Griffiths [email protected] wrote:

So was it looking for a different python installation when you were building before?

Does this work now?

source venv/bin/activatecd doc make html

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NeuroTechX/eeg-notebooks/issues/7#issuecomment-681666387, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA36GFORF4RA5N3JESMOED3SCYBUTANCNFSM4QKGJAIA .

-- Kyle E. Mathewson, Ph.D. Assistant Professor - Department of Psychology, Faculty of Science Director - Attention Perception and Performance Lab Affiliate - Neuroscience and Mental Health Institute, Faculty of Medicine and Dentistry University of Alberta P455 - Biological Sciences Building 11455 Saskatchewan Dr. Edmonton, Alberta, Canada, T6G 2E9 Phone: 1-780-492-2662 Email: [email protected] Web: www.kylemathewson.com

kylemath avatar Aug 27 '20 07:08 kylemath

Must be trying to use a different python installation then, if the import isn't working.

JohnGriffiths avatar Aug 27 '20 07:08 JohnGriffiths

@kylemath - checking up on this. We have tried to iron out the dependencies in requirements.txt a bit more.

please try:

  1. fresh git clone, or pull updates

  2. create fresh conda or venv

  3. pip install

pip install -e .

  1. build docs as above

make html

Are you still getting an error?

JohnGriffiths avatar Nov 25 '20 15:11 JohnGriffiths

(venv) Kyles-MacBook-Pro:eeg-notebooks kylemathewson$ make html
make: *** No rule to make target `html'.  Stop.
(venv) Kyles-MacBook-Pro:eeg-notebooks kylemathewson$ cd docs
-bash: cd: docs: No such file or directory
(venv) Kyles-MacBook-Pro:eeg-notebooks kylemathewson$ ls
LICENSE			eegnb			requirements_test.txt
README.rst		examples		run_notebooks.py
binder			requirements-docs.txt	setup.cfg
doc			requirements-noeeg.txt	setup.py
eeg_notebooks.egg-info	requirements.txt	venv
(venv) Kyles-MacBook-Pro:eeg-notebooks kylemathewson$ cd doc
(venv) Kyles-MacBook-Pro:doc kylemathewson$ ls
Makefile	changelog.rst	docs_notes.md	getting_started	index.rst
_static		conf.py		experiments	img		misc
(venv) Kyles-MacBook-Pro:doc kylemathewson$ make html
/bin/sh: sphinx-build: command not found
make: *** [html] Error 127
(venv) Kyles-MacBook-Pro:doc kylemathewson$ 

kylemath avatar Nov 26 '20 06:11 kylemath

Apols.

Ok I've added the doc building dependencies into the requirements.txt. That's easier than maintaining multiple installation instructions.

Pls git pull master and try pip install -e . again.

Note that the env needs to be with Python 3.6.

JohnGriffiths avatar Nov 29 '20 20:11 JohnGriffiths