Unable to Get Panel Working with Jupyter notebook

Hi Carl,

I cannot thank you enough for all the detailed instructions. It worked! God Bless you and your family!

Thank you, thank you …

Vivek

2 Likes

Thanks Riziles, We got it working using Carl’s detailed guidelines!

2 Likes

Carl,

Can I buy you a coffee? I can import panel as pn now. I have been struggling for two weeks. Hopefully this weekend I will start programming.

Thanks a million once again.

Regards,

Vivek

4 Likes

always install/pdate panel and other related holoviews ,datashader from pyviz

conda install -c pyviz holoviews bokeh hvplot datashader panel

conda update -c pyviz holoviews bokeh hvplot datashader panel

1 Like

Hey @khannaum, it’s actually not necessary to install the holoviz tools from the pyviz channel. They are also available on defaults and on conda-forge. We usually recommend pyviz as it’s the one we have completely control over, when we release a new version it is immediately available on this channel. Usually then the release happens pretty quickly on conda-forge, a few hours or days later. The release in the defaults channel happen later, we don’t have control over that but we’re are working on improving that so that there’s less lag.

2 Likes

Thanks to all of you including Marc. We were able to install panel with Carl’s detailed instructions.

Panel is acting up again.

I followed same procedure as Carl outlined and last time I was able to issue import panel as pn and got no error.

Today is a different story

What am I doing wrong?

Hi @Vivek,

I don’t think it’s panel, in your picture what options do you get if you click ‘Python 3’? Top right of your picture… This is the kernel (I believe) that is being used to run jupyter, you can think of it as the engine. I’m thinking the wrong engine is selected and you need to change it to the correct engine or kernel that has panel powering it.

Thanks, Carl.

You are right again, I chose vm1 as kernel and it does not complain! I still do not get it, could you please explain the mystery in layman words for a PhD in Chem. Eng. but “0” in Panel

You have two engines under the hood just now:

Engine 1 (vm1) is fulled by the good stuff
Engine 2 (python3) is not fulled

In this case engine1 is vm1, this is linked to your virtual machine that you have installed panel into, when you run a cell and this vm1 kernel is selected it has all the powers / features you have installed into its virtual environment. Engine 2 (python 3) I believe is your base environment and this does not include panel it will only have access to python features and anything else that may happen to be installed. So when you run the cell and python 3 is highlighted you get your error because panel is not available for it to use in essence it’s the wrong engine

So the beauty of this is you can build different engines to operate in jupyter lab, the engine can include panel or maybe you don’t want it to and include some other stuff. I started with building engines to try and fit every need, now I try to build an engine for my need. So if I want graphs I have an engine with the pyviz tools, if I just want to transform some data I might have another engine with pretty much just pandas for example.

There’s quite a bit more to it than this so it would well be worth reading into jupyter lab and virtual environments.

Note:

Let’s imagine a scenario here, you start coding today, you finish and everything works. Great. Now you park vm1 in the garage. Why is a good question. Because tomorrow panel releases an update that is no longer backward compatible with the code you’ve written. Remember this is a scenario but holds true for not just panel but other technologies your making use of. So your code you wrote today no longer works with tomorrows greatness. But wait you parked vm1 in the garage, you can now bring off the dust covers and run yesterdays code fantastic and maybe that was quicker, simpler and more manageable than re-writing something that once worked. Just another use for these virtual machines. So your code will work for all time… kinda

Thanks Carl for educating the ignorant me. Now I understand it much better, I am going copy paste into word document for future reminders!

Just for the sake of completeness, @Vivek what you experienced here has nothing to do with Panel or HoloViz :upside_down_face: It has to do with some other tools - namely JupyterLab, conda and the Anaconda distribution - and how they manage environments and connect together. Usually it works pretty seamlessly but it seems that you ended up in a weird state. Happy you managed to get this sorted out, thanks to all those that tried to help you in this thread, amazing community :heart_eyes: !

1 Like

I want to say this thread is a goldmine , especially the troubleshoot steps . Its something that took me weeks of troubleshooting to figure out a workflow to fix common problems and time and time again becomes a reboot exercise . Always having to do with environments . Has nothing to do with holoviz or panel , and surprisingly the little snippets i accumulated over time match perfectly with carls reboot steps . Its the first place where ive seen it thoroughly laid out with steps with photos . A testament to how good this community is . For people who run into issues ,this thread is a gold mine . To me its akin to rebooting a computer whenever you cant figure out whats wrong

The only other thing in my cheatsheet that isnt in carls list … and this might be random or voodoo … but dont mix pip with conda … and stick to conda … period . It never ends well in my experience

2 Likes

Thanks maximlt for you help as well, perhaps I did not catch the subtle hints that you were telling me all along. My apologies, it is my lack of knowledge in this area. Hopefully I will get better with time

I agree with you after my experience! Thanks to all of you

1 Like

I tried to install plotly and openpyxl under vm1, it gives me this error, what does it mean?

They are part of base environment, but then panel is not!

Openssl probably runs in linux only. It is always better open a new topic, so other people can find the topic more easily.

Try install them the two packages separately. Plotly should work ok.

I tried installing plotly separately per your guidance, it does not seem to work!

Now I am on my windows pc, try these commands

conda install -c plotly plotly
conda install -c anaconda openpyxl

who where extracted from

https://anaconda.org/anaconda/openpyxl

When you put the -c option in the commandline, you are telling go to look for to a particular channel (or repository) of the package (Conda channels — conda 22.9.0.post94+887d03470 documentation). Sometimes in that channel the package is not found, and you need to specify other channel. I usually google it and the package documentation or the anaconda.org page of the repository help a lot.


Same issue, it will not install for some reason