anaconda / nbpresent

next generation slides for Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
162 stars 23 forks source link

Lacking static content #36

Closed akhmerov closed 8 years ago

akhmerov commented 8 years ago

It seems some files are missing from v0.5 (or paths aren't updated in install.py):

>  python3 -m nbpresent.install

Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.4/dist-packages/nbpresent/install.py", line 120, in <module>
    install(**parser.parse_args().__dict__)
  File "/usr/local/lib/python3.4/dist-packages/nbpresent/install.py", line 40, in install
    install_nbextension(directory, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/notebook/nbextensions.py", line 220, in install_nbextension
    _maybe_copy(src, full_dest, verbose)
  File "/usr/local/lib/python3.4/dist-packages/notebook/nbextensions.py", line 50, in _maybe_copy
    if _should_copy(src, dest, verbose):
  File "/usr/local/lib/python3.4/dist-packages/notebook/nbextensions.py", line 37, in _should_copy
    if os.stat(src).st_mtime - os.stat(dest).st_mtime > 1e-6:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.4/dist-packages/nbpresent/static/nbpresent'
bollwyvl commented 8 years ago

Thanks for the report. I had seen that on some of the weirder windows builds, but hadn't encountered that in a *nix yet. What platform is this, and what source of python? Also, had you python setup.py developed or python setup.py installed or pip installed?

akhmerov commented 8 years ago

Ubuntu, OS-wide 3.4 latest pip, installed via

sudo -H pip3 install git+https://github.com/Anaconda-Server/nbpresent.git@v0.5.0
akhmerov commented 8 years ago

NB 0.5.0 isn't on pypi yet, hence the installation from the repo.

bollwyvl commented 8 years ago

That's a pretty tough install for me to fully test without setting up a whole VM... but I'll see what i can do.

In the nearer term, I'll try to get a 0.5.0 out on pip!

akhmerov commented 8 years ago

Same inside a fresh virtualenv, actually.

bollwyvl commented 8 years ago

Just pushed nbpresent 0.5.0 to pypi. Gave it a spin with 3.4, seems okay.

Ah, I know the source of the issue. It is indeed the case that there are no static assets in the repo, as everything is built into that location by all the various tasks. This is a relatively new development, as previously I did store the whole 2MB of built assets in a submodule, but other folks were having issues with that, so I took it out. I was pretty bad at keeping them up to date, and don't know how it would play with pip anyway.

Or, put differently, installing directly from github is no longer an option, even if it did at one time work. To work directly off the repo, one would have to:

git clone https://github.com/Anaconda-Server/nbpresent.git
cd nbpresent
python setup.py develop
npm install
npm run build:release
python -m nbpresent.install --user --symlink

Which isn't a ton of stuff more than the baseline, but still a fair amount.

So anyhow, since it was never documented that it would work with pip install git+..., I don't think I've really broken any contracts :)

akhmerov commented 8 years ago

Thanks for the clarification, it works just like you said.

bollwyvl commented 8 years ago

"Works" is what we need first, but certainly let me know if there is anything you discover that would make nbpresent more useful! There are a number of broad issues open, such as theming, but really anything helps. I've been concentrating a lot on test and packaging, so we've got a much better baseline for moving forward with great, new features.

On 05:48, Wed, Jan 27, 2016 Anton Akhmerov notifications@github.com wrote:

Thanks for the clarification, it works just like you said.

— Reply to this email directly or view it on GitHub https://github.com/Anaconda-Server/nbpresent/issues/36#issuecomment-175549697 .