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

no output on MacOS #160

Closed
AshtonSBradley opened this issue Jul 23, 2018 · 26 comments
Closed

no output on MacOS #160

AshtonSBradley opened this issue Jul 23, 2018 · 26 comments

Comments

@AshtonSBradley
Copy link

I am using Jupyter on MacOS (in Chrome) and getting no output.

If I run

using WebIO
display(Node(:input, attributes = Dict("type" => "range")))

nothing appears.

Pkg.status("WebIO")
 - WebIO                         0.2.4
versioninfo()
Julia Version 0.6.4
Commit 9d11f62bcb (2018-07-09 19:09 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=16)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)
@SimonDanisch
Copy link
Member

I think I can reproduce and see errors in the console:
grafik

@SimonDanisch
Copy link
Member

Hm, I tried 0.2.2 up to master and it all didn't work^^ Also 0.2.5 + 0.2.6 seem to be unknown to metadata?!
Anything I'm missing, or has the IJulia support been broken for a long time now? ;)

@AshtonSBradley
Copy link
Author

ah, yes, that would be consistent with an issue I opened on InteractNext.jl a while back ( I didn't realise that everything had moved over to InteractBase)

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

I actually use WebIO daily in Jupyter, so this should definitely be working 🙂

I just did the following to test:

  • created a brand new julia package directory
  • Pkg.init()
  • Pkg.add("IJulia")
  • Pkg.add("WebIO")
  • using IJulia; notebook(dir=pwd())

and then created a new notebook, and WebIO worked just fine:

screenshot from 2018-07-23 21-24-28

This is with Julia v0.6.4 on Ubuntu 18.04, with the following Pkg.status():

julia> Pkg.status()
2 required packages:
 - IJulia                        1.9.0
 - WebIO                         0.2.4
16 additional packages:
 - AssetRegistry                 0.0.2
 - BinDeps                       0.8.8
 - BinaryProvider                0.3.3
 - Compat                        1.0.0
 - Conda                         0.8.1
 - FunctionalCollections         0.3.2
 - JSON                          0.17.2
 - MbedTLS                       0.5.12
 - Nullables                     0.0.6
 - Observables                   0.1.2
 - Pidfile                       1.0.0
 - Requires                      0.4.4
 - SHA                           0.5.7
 - URIParser                     0.3.1
 - VersionParsing                1.1.1
 - ZMQ                           0.6.2

Can you try following those steps and seeing if it works for you? We just need to figure out what's different between your setup and mine.

@AshtonSBradley
Copy link
Author

AshtonSBradley commented Jul 24, 2018

I am happy to try this. Just to check - should I be clearing .julia first, or can I initialise the package directory somewhere else?

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

No, you don't need to clear out .julia. To make a nice clean package directory, you can do the following:

  • (in your terminal, make a new temporary directory and cd into it
  • Create a new package folder with mkdir packages
  • Tell Julia to use it by setting the environment variable with export JULIA_PKGDIR=`pwd`/packages
  • Start Julia
  • julia> Pkg.init()
  • julia> Pkg.add("IJulia")
  • etc.

Julia will use that package directory whenever it's launched from a terminal with the export JULIA_PKGDIR=... set.

When you're done, you can just delete that whole folder.

@AshtonSBradley
Copy link
Author

AshtonSBradley commented Jul 24, 2018

I tried that, but now julia doesn't finish executing even basic commands (cells just have a * but don't finish).

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

Maybe you have a very old version of jupyter installed? Can you try repeating the above steps, but before you do Pkg.init(), can you also run (in your terminal, not Julia)

export PYTHON=""
export JUPYTER=""

@dpsanders
Copy link

I don't get any output either for the Node test, using WebIO 0.2.4 on MacOS with Jupyter notebook version 5.4.1, on Chrome.

@AshtonSBradley
Copy link
Author

AshtonSBradley commented Jul 24, 2018

ok, I did the new steps. Seems to be running Julia properly, but no change in this node test (I think it was installing a newer Jupyter anyway, as it has a new arrow on the active cell I hadn't noticed before).

@AshtonSBradley
Copy link
Author

screen shot 2018-07-23 at 8 10 58 pm

@AshtonSBradley
Copy link
Author

2 required packages:
 - IJulia                        1.9.0
 - WebIO                         0.2.4
16 additional packages:
 - AssetRegistry                 0.0.2
 - BinDeps                       0.8.8
 - BinaryProvider                0.3.3
 - Compat                        1.0.0
 - Conda                         0.8.1
 - FunctionalCollections         0.3.2
 - JSON                          0.17.2
 - MbedTLS                       0.5.12
 - Nullables                     0.0.6
 - Observables                   0.1.2
 - Pidfile                       1.0.0
 - Requires                      0.4.4
 - SHA                           0.5.7
 - URIParser                     0.3.1
 - VersionParsing                1.1.1
 - ZMQ                           0.6.2

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

What are the contents of your ~/.jupyter/jupyter_notebook_config.py file?

@AshtonSBradley
Copy link
Author

###JULIA-WEBIO-CONFIG-BEGIN
import sys, os
if os.path.isfile("/Users/abradley/packages/v0.6/WebIO/deps/jlstaticserve.py"):
    sys.path.append("/Users/abradley/packages/v0.6/WebIO/deps")
    c = get_config()
    c.NotebookApp.nbserver_extensions = {
        "jlstaticserve": True
    }
else:
    print("WebIO config in ~/.jupyter/jupyter_notebook_config.py but WebIO plugin not found")
###JULIA-WEBIO-CONFIG-END

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

ok, that looks fine. Let me pull out my old mac and give it a try...

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

Ok, yeah, I can reproduce the error on a totally clean OSX package installation.

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

Ok, figured it out. Try running jupyter notebook from your terminal. When I do that, the first thing that's printed is a warning message:

[W 00:11:37.798 NotebookApp] Collisions detected in /Users/rdeits/.jupyter/jupyter_notebook_config.py and /Users/rdeits/.jupyter/jupyter_notebook_config.json config files. /Users/rdeits/.jupyter/jupyter_notebook_config.json has higher priority: {
      "NotebookApp": {
        "nbserver_extensions": "{'jlstaticserve': True} ignored, using {'jupyterlab': True}"
      }
    }

That warning is important: it means that the Jupyter .json configuration file is taking priority of the Jupyter .py configuration file. But WebIO uses that .py config file to load the server-side extensions that it needs.

If you see the same warning, please try:

mv ~/.jupyter/jupyter_notebook_config.json ~/.jupyter/jupyter_notebook_config.backup.json
jupyter notebook

(you need to re-launch jupyter notebook after doing this, since we need to restart the jupyter server itself).

Doing those two steps fixed WebIO on my mac.

@AshtonSBradley
Copy link
Author

yes - the Node test now runs!

@rdeits
Copy link
Collaborator

rdeits commented Jul 24, 2018

Ok, great! Now we just have to figure out why that conflicting file exists on mac and what to do about it

@SimonDanisch
Copy link
Member

On windows, I actually get this:

julia> run(Cmd(IJulia.notebook_cmd))
WebIO config in ~/.jupyter/jupyter_notebook_config.py but WebIO plugin not found
[I 11:15:56.282 NotebookApp] JupyterLab beta preview extension loaded from C:\Users\sdani\.julia\v0.6\Conda\deps\usr\lib\site-packages\jupyterlab
[I 11:15:56.292 NotebookApp] JupyterLab application directory is C:\Users\sdani\.julia\v0.6\Conda\deps\usr\share\jupyter\lab

@SimonDanisch
Copy link
Member

Ah, the paths were all not propperly escaped....
Now I get:

julia> run(Cmd(IJulia.notebook_cmd))
[W 11:17:49.275 NotebookApp] Error loading server extension jlstaticserve
    Traceback (most recent call last):
      File "C:\Users\sdani\.julia\v0.6\Conda\deps\usr\lib\site-packages\notebook\notebookapp.py", line 1481, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "C:\Users\sdani\.julia\v0.6\Conda\deps\usr\lib\importlib\__init__.py", line 37, in import_module
        __import__(name)
    ImportError: No module named jlstaticserve
[I 11:17:49.309 NotebookApp] JupyterLab beta preview extension loaded from C:\Users\sdani\.julia\v0.6\Conda\deps\usr\lib\site-packages\jupyterlab
[I 11:17:49.309 NotebookApp] JupyterLab application directory is C:\Users\sdani\.julia\v0.6\Conda\deps\usr\share\jupyter\lab

@dpsanders
Copy link

@rdeits's suggestion fixed it for me too, many thanks!
No idea why that's happening, though.

@AshtonSBradley
Copy link
Author

This fixed my fresh package install, but now I tried it for my usual Julia package directory, and the problem is not fixed

@SimonDanisch
Copy link
Member

Well, windows still doesn't work, so I guess there are still other issues hiding ;)

@shashi
Copy link
Member

shashi commented Jul 25, 2018

Could you try #162 after moving the backed up json file back to its original location?

mv ~/.jupyter/jupyter_notebook_config.backup.json ~/.jupyter/jupyter_notebook_config.json

and see if Pkg.build("WebIO") on that branch fixes?

@SimonDanisch
Copy link
Member

Just came here to complain that you ignored the windows problem, but it is actually working now :)
grafik

Thanks @shashi :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants