Canopy / iPython Notebook Image Issue - enthought

I've installed Enthought Canopy 1.3.0.1715 on Max OSX 10.9.2, and updated all packages. All seems to have gone well until trying to create a new iPython notebook. When the notebook opens, none of the buttons for the notebook contain any images (just small 'x''s). II believe this problem is causing other issues in notebooks, but I'd like to get this one fixed first. Has anyone seen this and have a solution / idea? FYI, This works fine starting notebook from the terminal, just not as how Canopy is hosting the notebook.

Related

Why has Jupyter notebook kernel stopped working after RStudio package installation

To date I have been using Jupyter Notebook to run R and sometimes Python code. I have also been using RStudio at times. Recently, while using RStudio, I was prompted to install some package (cannot exactly remember). At any rate, I installed this package. Dont know if only coincidence, but trying to run R in the notebook resulted in kernel not connecting. I found the same issue with Python, the Python kernel is also not connecting anymore.
Executing the below, I get;
(base) C:\WINDOWS\system32>jupyter kernelspec list
Available kernels:
ir C:\Users\Admin\AppData\Roaming\jupyter\kernels\ir
python3 C:\Users\Admin\anaconda3\share\jupyter\kernels\python3
How do I get Jupyter Notebook's kernels to work again.
Executing IRkernel::installspec() in R via Anaconda CMD prompt have resolved the issue. Note for others with this issue, you may be prompted to run install.packages(“rlang”) before.

Issue with Pylance and matplotlib

I have looked at these problems online but I don't seem to be able to find a good answer.
System details:
Mac OS BigSur 11.6 on a M1 MacBook Pro
Installed miniforge as discussed here
Installed VSCode for Mac
I have these two following (unrelated?) problems when using jupyter notebook:
PyLance does not resolve imports like numpy etc. I see that os or sys are recognized and resolved but pretty much nothing else is. The kernel used by the jupyter notebook is the correct one. Indeed I am able to run the code with no issues but I get all these unrecognized imports.
I am not able to run the jupyter notebook with %matplotlib notebook. I can run with %matplotlib inline, but then I am not able to see the widgets to zoom in etc. To be more precise, if I try to plot in a cell then after it I see the following:
either nothing or
the following <IPython.core.display.HTML object>
This is achieved by clicking on the symbol </> and changing the rendered from html to text.
I am wondering if there is some issue with my installation of python and jupyter on the M1 or it is a VSCode issue. Any suggestion on where to look into the problem(s)?

Jupyter Python logo

Does anyone know how to add Python logo to the top right corner of python notebooks in Jupyter ?
I see Ruby notebooks are added w/ Ruby logo automatically.
Can this be done in Python notebooks ?
Zarak, This is what I see
$ jupyter kernelspec list
Available kernels:
python2 d:\Continuum\Anaconda2\lib\site-packages\ipykernel\resources
ruby d:\eclipse\.ipython\kernels\ruby
$ pwd
/d/Continuum/Anaconda2/lib/site-packages/ipykernel/resources
$ ls
logo-32x32.png logo-64x64.png
This is NOT a solution, but an amelioration of the problem...
I had (still do) similar issue on my OS X 10.7. In my case, jupyter's python kernel, while not able to find logo-64x64.png file, would auto-redirect me to 404 page as soon as Notebook loads - so I was not able to use Notebooks at all.
If anyone else is having similar issue, I suggest to try any of the following steps (until you can use Notebook again). I still see 404 GET /kernelspecs/Python%20[Root]/logo-64x64.png message in Terminal - however, now I do not get redirected to 404 page automatically upon loading the Notebook.
initially I was using Firefox as default browser, however I switched to Chrome.
initially I only had kernel for python2.7 installed. Now I added kernel for python3.
I generally call jupyter with --notebook-dir argument. I copied into the folder I specify in that argument - the files from location, which I get by running jupyter kernelspec list (2 logo files and 1 json file)
In the end, I still have the same issue - and I am anxiously waiting for somebody else to respond with a solution. However, hope this helps some people in the meantime.

IPython notebook does not produce output

I have just installed IPython 2.0 (April 2014) through Anaconda (64 bit) on a brand new pc with windows 7 (64 bit), performed the updates suggested and installed some packages with "$ conda install ".
I am loading IPython notebook with firefox and chrome. they are not the default browsers, so I used the information in this answer: https://stackoverflow.com/a/15748692/2344958
When I run IPython Notebook, it presents the landing pages and open new or imported notebooks, but it does not produce any output for cells.
I have no clue.
The only thing I can see is that the web console reports "Empty string passed to getElementById()."
Console works fine.
Any suggestion?
I found a page describing exactly the problem I had.
here the page:
Getting output with IPython Notebook
I actually have Sophos, but I have no control over it, and the solution that works so far was to start IPython with:
ipython notebook --ip=localhost
It also works by editing the line in configuration file
c.NotebookApp.ip = 'localhost'

Display of music21, musicXML PNG objects using iPython Notebook/Enthought Canopy

I am experimenting with the music21 library, in preparation for a Machine Learning project that involves genre classification and categorization. I and following some tutorials available here. I am using MuseScore as my MusicXML program, and I am trying to run the whole thing from iPython.
Although I can run the some of the turtorials from the terminal, some elements don't seem to run well from inside iPython. For example:
In [3]: sBach.show()
Out[3]: <music21.ipython21.objects.IPythonPNGObject at 0x10da0aa10>
The line above shows that the PNG object is created, but not displayed. The expected output for 3 above is the following:
Experimenting with the following iPython command, I get a placeholder for an image, but not image.
In [6]: %load_ext music21.ipython21.ipExtension
In [7]: sBach.show()
I can't find any problem with my MusicXMLPath. This tutorial refers to the use of musc21 with Anaconda, but all my developments is done with Enthought, so I prefer not to run another virtual environment to use music21 with iPython.
Is there any way to run music21 in an Enthought/iPython notebook?
I have been grappling with this issue myself. ... Have you set your musicxmlPath in music21? If you have not, it's done via environment.set(key, value). You can query for available keys with environment.keys(). I hope this isn't too simple an answer, but it cleared up the problem for me.
This should be in the iPython music21 documentation somewhere, my apologies: iPython in music21 requires Lilypond to be installed for images to be generated within the notebook itself. There hasn't been (and won't be until MuseScore 2.0 is released) a way using MusicXML to generate PNG images of scores directly.
Edit: 2015 July; music21 2.0 w/ MuseScore 2 will generate the PNG images with MuseScore if it is installed and fallback to Lilypond if it is not installed.
If not yet tried, some steps to isolate the cause of the problem:
1) Update to the latest Canopy (Edit: currently 1.4.1) (might help this, will help generally, won't hurt).
2) Change the Pylab backend in Canopy's IPython shell to "Inline (SVG)", via Preferences / Python. (The default Qt backend in that shell conflicts with music21's use of the tkinter library.)
3) Test your script in that shell rather than in the notebook.
4) Ensure that Canopy User Python is your default Python in a Terminal window, as described here.
5) Test your scripts inside of plain ipython terminal (from Terminal, type ipython).
6) Test in ipython terminal in pylab mode (ipython qtconsole --pylab=inline).
7) Test your scripts inside of ipython notebook running in a regular browser (from Terminal, type ipython notebook, and/or ipython notebook --pylab=inline).
Had similar issues before. It's the same problem when people try to use plot function in ipython/jupyter notebook. You need to call
%matplotlib inline
For me the issue was solved by uninstalling the snap version of musescore and installing it from ppa:mscore-ubuntu/mscore3-stable via https://launchpad.net/~mscore-ubuntu/+archive/ubuntu/mscore3-stable