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

%matplotlib notebook issue #21

Open
Zhilei opened this issue Oct 16, 2019 · 13 comments
Open

%matplotlib notebook issue #21

Zhilei opened this issue Oct 16, 2019 · 13 comments

Comments

@Zhilei
Copy link

Zhilei commented Oct 16, 2019

I was trying to use
%matplotlib notebook instead of %matplotlib inline to have interactive plotting tools. But I got errors with the last line as

ModuleNotFoundError: No module named 'ipympl'

I was wondering whether this can be fixed by modifying the loaded modules.

Thank you so much!

@ickc
Copy link
Contributor

ickc commented Oct 16, 2019

Can you install that dep. by yourself? I think the way Ted set it up point the user packages location somewhere in your home. So in the terminal if you load the cmbenv and conda/pip install then probably it will work.

@tskisner
Copy link
Member

tskisner commented Oct 16, 2019

I just installed this in the live version (20191012) and added it to the default list of packages:

hpc4cmb/cmbenv@67505cf

As @ickc mentioned, one could also probably pip install it to your user directory. Just be careful if you are swapping between incompatible python stacks and trying to use a package installed in your user space. One could also create a new conda env, but then you would have to replicate all the packages in the cmbenv stack.

@zonca
Copy link
Member

zonca commented Oct 30, 2019

@tskisner is this fixed in the cmbenv we are going to use for Trieste?

@tskisner
Copy link
Member

I did install the package requested, however, I think using this feature requires support from the NERSC jupyter installation, not our software stack.

@zonca
Copy link
Member

zonca commented Nov 4, 2019

I looked at the docs at https://github.com/matplotlib/jupyter-matplotlib,
it looks like to have JupyterLab support we need:

# If using JupyterLab
conda install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib

However it is quite annoying to have to install nodejs...
@tskisner If you think this is easy enough it would be good to have, otherwise let's close this issue.

@ickc
Copy link
Contributor

ickc commented Nov 4, 2019

Since the Jupyterlab instance is not started by us, but provided at NERSC, I don't think we can install our own jupyter lab extension? I think this is what @tskisner is referring to.

I wonder if spin can be used to deploy our own stack including the Jupyterlab itself, and I wonder if MPI can even be used with spin. But Spin has been in the "pilot phase" for a long time meaning that only people registered for training can deploy spin applications. (Spin relies on container.)

@zonca
Copy link
Member

zonca commented Nov 4, 2019

ah yes, sorry,
then I'll open a ticket and ask if they can install this

@tskisner
Copy link
Member

tskisner commented Nov 4, 2019

Yes, I was saying exactly what @ickc mentioned- this is something that would have to be changed by NERSC. The cmbenv stack already contains jupyter-notebook, so I also tried this:

$>  module load cmbenv
$>  source cmbenv
$>  salloc -N 1 -C haswell -A mp107 --qos=interactive -t 04:00:00
%> hostname
     nid00077
%> ifconfig -a
note IP address = 10.128.0.78
%> jupyter-notebook --no-browser --port 8889

And then I installed firefox on cori and tried to connect to my running notebook on the compute node using the IP address. However, it looks like they are blocking direct connections.

@zonca
Copy link
Member

zonca commented Nov 5, 2019

Rollin replied that the extension is already installed, in fact it works with the default kernel (but using %maptlotlib widget instead of %matplotlib notebook

image

Now if I test with CMB 20191012, also using %matplotlib widget, it hangs at "Loading widget" my guess is that there are different versions of some of the libraries between our kernel and the NERSC Kernel.

image

@zonca
Copy link
Member

zonca commented Nov 5, 2019

I see we have 0.2.2 and they have 0.3.3, @tskisner can you try to update ipympl to 0.3.3.
If this doesn't work let's close this issue anyway, don't want to spend too much time.

@ickc
Copy link
Contributor

ickc commented Nov 5, 2019

And then I installed firefox on cori and tried to connect to my running notebook on the compute node using the IP address. However, it looks like they are blocking direct connections.

In the past when I tried, it only works when it is reverse tunneling.

@rcthomas
Copy link

rcthomas commented Nov 5, 2019

Indeed this is probably a compatibility issue and may be resolved by upgrading ipympl.

@rcthomas
Copy link

rcthomas commented Nov 5, 2019

BTW let me know if you guys want to meet to discuss your needs, happy to help.

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