IRkernel DOES NOT exist when using windows CMD but DO exist when using Git Bash - jupyter-lab

I'm trying to install IRkernel for Jupyterlab. I have R-4.1.3. For some reason when calling jupyter-lab from Windows Command Prompt (CMD) I get this error:
Error in loadNamespace(x) : there is no package called 'IRkernel'
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Ejecución interrumpida
[I 2022-11-19 01:02:22.714 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new
random ports
Error in loadNamespace(x) : there is no package called 'IRkernel'
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Ejecución interrumpida
[I 2022-11-19 01:02:25.744 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new
random ports
Error in loadNamespace(x) : there is no package called 'IRkernel'
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Ejecución interrumpida
But when I call jupyter-lab from Git Bash, I can user the R kernel with no problems

Related

EclipseCDT will not debug executable: Error creating process

I just installed EclipseCDT 2022-12, created the HelloWorld example app, compiled, but when I debug I get an error. I have both current MSYS2 (MinGW64) and Cygwin64 installed, neither environment works and fails with the same error:
Error in final launch sequence:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/Windows/system32/C:/Projects/cc3135/hello/C:/Projects/cc3135/hello/Debug/hello.exe, (error 2).
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/Windows/system32/C:/Projects/cc3135/hello/C:/Projects/cc3135/hello/Debug/hello.exe, (error 2).
Error creating process /cygdrive/c/Windows/system32/C:/Projects/cc3135/hello/C:/Projects/cc3135/hello/Debug/hello.exe, (error 2).
Any suggestions?
P.S. The hello executable runs fine in cmd.exe and under gdb.

jupyter menu [File] > [Open] fails with "404: Not found" at localhost:8888/files/undefined/tree

On an up to date Arch linux (Lx kernel 6.0.5), I run Jupyter client on Firefox 106.0 with iPython kernels built on Python (any version from 3.10.0 to 3.10.7). I do so for many other versions of Python for many projects, in the same conditions with Firefox, with no issue. Many of those nbs have markdown and latex in addition to cells with Python code.
No pbm, except when launching a nb (or just a notebook client) from any environment where python >= 3.10.0.0, < 3.11.0, I get this:
> jupyter nbclassic my_notebook.ipynb
[I 2022-10-28 17:34:09.727 ServerApp] jupyterlab | extension was successfully linked.
[I 20221028-173409.736 ServerApp] nbclassic | extension was successfully linked.
[I 2022-10-28 17:34:09.752 LabApp] JupyterLab extension loaded from /usr/lib/python3.10/site-packages/jupyterlab
[I 2022-10-28 17:34:09.752 LabApp] JupyterLab application directory is /usr/share/jupyter/lab
[I 20221028-173409.755 ServerApp] jupyterlab | extension was successfully loaded.
[I 20221028-173409.759 ServerApp] nbclassic | extension was successfully loaded.
[I 20221028-173409.761 ServerApp] Serving notebooks from local directory: /home/USER/Scratchbooks/Data-science
[I 20221028-173409.761 ServerApp] Jupyter Server 1.21.0 is running at:
[I 20221028-173409.761 ServerApp] http://localhost:8888/tree
[I 20221028-173409.761 ServerApp] or http://127.0.0.1:8888/tree
[I 20221028-173409.761 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 20221028-173412.362 NotebookApp] 302 GET /notebooks/my_notebook.ipynb (127.0.0.1) 1.24ms
[I 20221028-173413.418 ServerApp] 302 POST /login?next=%2Fnotebooks%2Fmy_notebook.ipynb (127.0.0.1) 1.26ms
[W 20221028-173414.606 ServerApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20221028173409 (127.0.0.1) 10.55ms referer=http://localhost:8888/notebooks/my_notebook.ipynb
[I 20221028-173414.893 ServerApp] Kernel started: b6f2f5d6-...............5295222a4ce
I do not understand where this warning [ServerApp] 404 GET /nbextensions/widgets/notebook/js/extension.js comes from. The only pages I could recover searching the web are in Chinese and deciphering them (yes ... I did) got me nowhere.
Then when I go to the notebook's File> Edit > [Open] menu item to get a directory listing where the nb is, a new window tries to open in Firefox at http://localhost:8888/files/undefined/tree and fails with: 404: Not found. You are requesting a page that does not exist. Simultaneously I get this log entry:
[W 20221028-173418.416 ServerApp] 404 GET /files/undefined/tree (127.0.0.1) 1.28ms referer=http://localhost:8888/notebooks/my_notebook.ipynb
Modifying the url by hand to http://localhost:8888/tree directly in the Firefox window produces the desired result and everything functions normally. I get the usual view of the file tree wherever the nb file I launched is located, etc.
After a whole day reading and probing, I disabled, then removed nb extensions, rebuilt custom kernels 5 times, changed and experimented with new Python versions inside the 3.10.x family. I keep getting the same error for all Python 3.10.x environments no matter what the iPython kernel for the nb is and no matter where the nb is located, as long as the jupyer nbclassic my_notebook.ipynb cmd is issued in a directory where python --version returns 3.10.x.
Right now I have this:
> jupyter nbextension list
Known nbextensions:
config dir: /home/USER/.jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
nbextensions_configurator/config_menu/main disabled
tree section
nbextensions_configurator/tree_tab/main disabled
config dir: /home/USER/.pyenv/versions/3.10.0/etc/jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
config dir: /usr/local/etc/jupyter/nbconfig
notebook section
nbextensions_configurator/config_menu/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/config_menu/main
tree section
nbextensions_configurator/tree_tab/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/tree_tab/main
config dir: /etc/jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
I have no clue as to what's frigging happening here. Any help is welcome, pointers whatever... Tx
[I've seen quite a few reports (here, here, here and here) over the last years. None helped. Also posted an Issue on Github .]

Jupyter Notebook : ERROR:asyncio:Exception in callback

I am using Jupyter Notebook in Windows 10 with Python 3.9.6. I have installed Jupyter Notebook with this command pip install jupyter and run it with this command jupyter notebook. So after starting the notebook, in the terminal I see some errors also but so far I don't seem to see any impact because of it. But still wanted to check, what that error actually indicates and is there a way to fix it?
[I 18:25:02.479 NotebookApp] Serving notebooks from local directory: C:\Users\maryo\Desktop\python\jpnb
[I 18:25:02.479 NotebookApp] Jupyter Notebook 6.4.3 is running at:
[I 18:25:02.479 NotebookApp] http://localhost:8888/?token=dfd2534b828985fcc116e9c400fd31381e9c8f19034e39d3
[I 18:25:02.479 NotebookApp] or http://127.0.0.1:8888/?token=dfd2534b828985fcc116e9c400fd31381e9c8f19034e39d3
[I 18:25:02.479 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:25:02.508 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/maryo/AppData/Roaming/jupyter/runtime/nbserver-17088-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=dfd2534b828985fcc116e9c400fd31381e9c8f19034e39d3
or http://127.0.0.1:8888/?token=dfd2534b828985fcc116e9c400fd31381e9c8f19034e39d3
c:\users\maryo\appdata\local\programs\python\python39\lib\json\encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
return _iterencode(o, 0)
[W 18:27:49.960 NotebookApp] Notebook Covid Data Analysis.ipynb is not trusted
ERROR:asyncio:Exception in callback <TaskStepMethWrapper object at 0x000002C98ECD81F0>()
handle: <Handle <TaskStepMethWrapper object at 0x000002C98ECD81F0>()>
Traceback (most recent call last):
File "c:\users\maryo\appdata\local\programs\python\python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-41' coro=<RequestHandler._execute() running at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\web.py:1660> cb=[_HandlerDelegate.execute.<locals>.<lambda>() at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\web.py:2326]> while another task <Task pending name='Task-40' coro=<MappingKernelManager.start_kernel() running at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\notebook\services\kernels\kernelmanager.py:176> cb=[IOLoop.add_future.<locals>.<lambda>() at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\ioloop.py:688]> is being executed.
ERROR:asyncio:Exception in callback <TaskStepMethWrapper object at 0x000002C98DA94880>()
handle: <Handle <TaskStepMethWrapper object at 0x000002C98DA94880>()>
Traceback (most recent call last):
File "c:\users\maryo\appdata\local\programs\python\python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-30' coro=<HTTP1ServerConnection._server_request_loop() running at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\http1connection.py:840> cb=[IOLoop.add_future.<locals>.<lambda>() at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\ioloop.py:688]> while another task <Task pending name='Task-40' coro=<MappingKernelManager.start_kernel() running at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\notebook\services\kernels\kernelmanager.py:176> cb=[IOLoop.add_future.<locals>.<lambda>() at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\ioloop.py:688]> is being executed.
C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\jupyter_client\ioloop\manager.py:9: RuntimeWarning: coroutine 'RequestHandler._execute' was never awaited
from .restarter import AsyncIOLoopKernelRestarter
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-41' coro=<RequestHandler._execute() running at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\web.py:1660> cb=[_HandlerDelegate.execute.<locals>.<lambda>() at C:\Users\maryo\Desktop\python\jpnb\lib\site-packages\tornado\web.py:2326]>
On the bright side, this issue can be avoided by configuring Notebook to run with its AsyncMappingKernelManager instead - which introduces a full async stack
This method is not a permanent method every time you open Jupyter notebook you need to add these settings
jupyter notebook --NotebookApp.kernel_manager_class=notebook.services.kernels.kernelmanager.AsyncMappingKernelManager
or
This method is a permanent method
Step 1
run
jupyter notebook --generate-config
This will create jupyter_notebook_config.py in your Jupyter folder. The Jupyter folder is in your home directory, ~/.jupyter
Step 2
find these two lines in that folder
## The kernel manager class to use.
# Default: 'notebook.services.kernels.kernelmanager.MappingKernelManager'
under that line add this line
c.NotebookApp.kernel_manager_class = 'notebook.services.kernels.kernelmanager.AsyncMappingKernelManager'
like this
## The kernel manager class to use.
# Default: 'notebook.services.kernels.kernelmanager.MappingKernelManager'
# c.NotebookApp.kernel_manager_class = 'notebook.services.kernels.kernelmanager.MappingKernelManager'
c.NotebookApp.kernel_manager_class = 'notebook.services.kernels.kernelmanager.AsyncMappingKernelManager'
Save and run jupyter notebook as normal
The suggested fix by Dumidu Parmith answer does not work for me due to
The 'kernel_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x7f0a210acc88> instance must be a type, but 'notebook.services.kernels.kernelmanager.AsyncMappingKernelManager' could not be imported
as mentioned in the comments to his answer.
As mentioned in the corresponding github issue installing jupyter_client<7 solved the issue for me.
So in case of conda, do
conda install 'jupyter_client<7'
and no configuration change is required. This installed version 6.1.2 in my case.
if you using anaconda, you try "pip install jupyter", instead of "conda install jupyter".

Python 3.7.0 and tcl/tk 8.6 crashing on Mac OS X 10.12.6

I'm trying to run a script under IDLE in a fresh install of Python 3.7.0 on a Mac running OS 10.12.6, but it appears to crash once it hits "root = Tk()".
The error generated is:
Process: Python [877]
Path: /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 3.7.0 (3.7.0)
Code Type: X86-64 (Native)
Parent Process: Python [872]
Responsible: Python [877]
User ID: 501
Date/Time: 2018-08-08 08:58:47.934 -0400
OS Version: Mac OS X 10.12.6 (16G1510)
Report Version: 12
Anonymous UUID: F9CEC001-40B2-1F01-C918-48794CEB9A07
Sleep/Wake UUID: 6743F7F2-F98A-4114-8742-809CF7F2C43B
Time Awake Since Boot: 22000 seconds
Time Since Wake: 5400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fba344e3f60'
abort() called
terminating with uncaught exception of type NSException
I have interrogated the tcl/tk library using:
print(root.tk.exprstring('$tcl_library'))
print(root.tk.exprstring('$tk_library'))
This reports the following:
/Library/Frameworks/Python.framework/Versions/3.7/lib/tcl8.6
/Library/Frameworks/Python.framework/Versions/3.7/lib/tk8.6
This appears to be correct given the information on Python.org here.
What should I be doing differently?

Overtone & Vim (Repl doesn't seems to be connected)

I tried to play with overtone on ubuntu, but I can't eval some of overtone's codes in Vim.
:Eval works for the clojure code; I tried it in vim (a clj file in the lein project directory), ex: (+ 1 2 3) => :Eval => appeared on the bottom of the vim window => 6, so it's ok.
But, for example, I tried:
(demo(sin-osc)) => :Eval ;(:Require don't change nothing)
It returned:
java.lang.RuntimeException: Unable to resolve symbol: demo in this context, comp
iling:(NO_SOURCE_PATH:1:1)
So here's what I do:
jack is started
lein repl is started in the lein project (deps is ok)
in the first terminal where there is lein I start overtone (use 'overtone.live), here is the log; I've got 2 errors:
user=> (use 'overtone.live)
--> Loading Overtone...
--> Booting internal SuperCollider server...
* ERROR: dlsym load err '/home/axxon/workspace/overtone/tutorial/native/linux/x86_64/libscsynth.so: undefined symbol: load'
Found 10 LADSPA plugins
* ERROR: open directory failed '/home/axxon/.local/share/SuperCollider/synthdefs'
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 44100,000000, driver's block size = 1024
--> Connecting to internal SuperCollider server...
--> Connection established
JackDriver: max output latency 23,2 ms
here, in this window I tried (demo(sin-osc)). it works; I can hear it.
Great, but now I want to script with Vim, so I created a new file (mytest.clj) in the lein project directory (/overtone/tutorial), I opened it with Vim (in another window)
in this blank file, I wrote the same thing as I said before, (demo(sin-osc)) and tried to eval with first, :Require, it returned this:
(clojure.core/require 'user :reload)
java.io.FileNotFoundException: Could not locate user__init.class or user.clj on
classpath:
with Eval, it doesn't work either.
Thanks for your help because I really want to use overtone!
Ps: my vim bundles:
Bundle 'guns/vim-clojure-static'
Bundle 'tpope/vim-fireplace'
Bundle 'tpope/vim-classpath'
Edit: I forgot to use a correct namespace, and in overtone's google group, i seen that mytest.clj must be in the src directory of the project. I tried this code with :Require (i stopped overtone in the first window where i started lein):
(ns tutorial.foo
(:use [overtone.live]))
(definst saw-wave [freq 440 attack 0.01 sustain 0.4 release 0.1 vol 0.4]
(* (env-gen (lin-env attack sustain release) 1 1 0 1 FREE) (saw freq) vol))
(saw-wave)
, but it returned:
(clojure.core/require 'tutorial.foo :reload)
Erreur détectée en traitant function <SNR>17_Require..fireplace#session_eval..<S
NR>17_eval..7 :
ligne 38 :
E605: Exception non interceptée : Error running Clojure: *** ERROR: open directo
ry failed '/usr/java/packages/lib/amd64'^#*** ERROR: dlsym load err '/usr/lib/jn
i/libswt-gtk-3836.so: undefined symbol: load'^#*** ERROR: dlsym load err '/usr/l
ib/jni/libswt-glx-gtk-3836.so: undefined symbol: load'^#*** ERROR: dlsym load er
r '/usr/lib/jni/libswt-webkit-gtk-3836.so: undefined symbol: load'^#*** ERROR: d
lsym load err '/usr/lib/jni/libswt-atk-gtk-3836.so: undefined symbol: load'^#***
ERROR: dlsym load err '/usr/lib/jni/libswt-pi-gtk-3836.so: undefined symbol: lo
ad'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-cairo-gtk-3836.so: undefined
symbol: load'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-awt-gtk-3836.so:
undefined symbol: load'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-gnome-gt
k-3836.so: undefined symbol: load'^##^## A fatal error has been detected by the
Java Runtime Environment:^##^## SIGSEGV (0xb) at pc=0x00007f5d261db671, pid=693
1, tid=140036632291072^##^## JRE version: 7.0_25-b30^## Java VM: OpenJDK 64-Bi
I was having the same problem. It turned out that the vim fireplace plugin was not connected to my bash repl session. I manually established the connection and everything worked just fine afterwards.
At the top of your lein session you should see the details about what port the repl session is running on
nREPL server started on port 35182 on host 127.0.0.1
So then you can connect vim-fireplace to that repl session by using
:Connect nrepl://localhost:35182
The reason why you can still evaluate code like (+ 1 2 3) even when vim-fireplace is not connected to the remote repl session is because vim-classpath will make it fall back to just spawning a new clojure runtime instance to evaluate that code. Once the fireplace repl connection is working you should notice that evaluating code becomes a lot faster since it doesn't need to load clojure from scratch.
Make sure that you use overtone.live in the namespace declaration of the file you are editing in vim, and that the REPL is running in a separate terminal instance. From vim, save the file (:w) and move your cursor into the ns declaration. Then hit gf to open the file for the namespace. Type cpR or :Require! and then cpp or :Eval the function you were trying to run. Hopefully this will work for you! Best of luck.

Resources