Open regmeg opened 6 years ago
Is it possible you've configured R to save and restore your namespace? Restarting the kernel really stops the kernel process and starts a new one, which we assume means a blank state, but it's possible for the language to restore variables if it wants to.
cc @flying-sheep
@takluyver thanks for your reply.
No, I haven't done anything deliberate to save and reload the workspace data. I've done couple of more experiments:
getwd()
for any .RData files, those were not present. Furthermore I've tried to run unlink("*.RData")
and unlink(".RData")
before running ls()
but that did not change anything.So the only way to reset the variables without running rm(list = ls())
explicitly is to shutdown a kernel and then do a restart. It does not seem related to the R workspace.
:confused: restart already does shut the kernel down and restart it. Maybe the issue is just that restart isn't doing anything for some reason? Is there any indication of anything happening when you press restart? Do the prompt numbers go back to In [1]:
afterwards? Are there any messages in the terminal where you're running the notebook?
That's actually a good spot - the prompt numbers dont go back toIn [1]:
. As expected they they go to In [ ]:
just after the restart, but when cells are being run again they keep incrementing. What could be the cause of that? That does not happen with python notebooks.
That means that it's not actually doing the restart. Look in the terminal that you launched the notebook from, see if there are any error messages.
That's what i get:
[I 09:13:46.746 NotebookApp] Starting buffering for 80e3d8c8-000c-455b-9014-927406373546:c7d54c89ca014873a912b56b6f4670e4
[I 09:13:51.845 NotebookApp] Kernel restarted: 80e3d8c8-000c-455b-9014-927406373546
[I 09:13:51.888 NotebookApp] Adapting to protocol v5.0 for kernel 80e3d8c8-000c-455b-9014-927406373546
[I 09:13:51.890 NotebookApp] Restoring connection for 80e3d8c8-000c-455b-9014-927406373546:c7d54c89ca014873a912b56b6f4670e4
[I 09:13:51.893 NotebookApp] Replaying 2 buffered messages
R_zmq_bind errno: 100 strerror: Address in use
R_zmq_bind errno: 100 strerror: Address in use
R_zmq_bind errno: 100 strerror: Address in use
R_zmq_bind errno: 100 strerror: Address in use
R_zmq_bind errno: 100 strerror: Address in use
I'm not exactly sure which address does it complain about. There's no stack trace or anything. I've tried to run the notebook with different ports, but that does not seem to be the issue.
These guys seems to have had similar issues: https://github.com/jupyter-incubator/enterprise_gateway/issues/8
Thanks
That sounds like it's trying to start the new kernel but it hasn't shut down the old one. @flying-sheep, have you come across anything like this?
nope, never. sorry!
I get exactly the same error.
I also had this same error and in my case was able to narrow the issue down to ".RData" and ".Rhistory" files that I had created using R Studio and saved in a directory. When I use Jupyter Notebook to create a new "R notebook" in THAT folder that contains the RData file the new notebook inherits the data in the .RData file. If I create a new R notebook in a different directory with no .RData file or delete the existing .RData file and create a new notebook in that directory, no inherited variables.
Hi,
It seems like R notebooks don't get their variables reset after the Restart commands are run.
It's very simply to reproduce, firstly define a variable and print the defined variables:
then remove the variable definition and simply print out the defined variables by running "Restart & Run All" or "Restart/Restart & Clear Output" and running the cell with:
ls()
I've done a similar experiment with a python notebook and seems to be working OK.
I'm running my notebook server from the Anaconda Prompt on Windows 10, version outputs from the prompt:
conda list anaconda
conda list R
conda list jupyer
This is kind of small bug, but can lead to some very serious miscalculations in a notebook.
Thanks, Rihards