How do I add a local image to an IJulia notebook? The image is in the same local network folder as the IPYNB file. The folder is accessed via a symbolic link. I've tried both relative and absolute file names.
<img src="test.png" alt="Image Test" style="width:600px">
![Image Test](test.png)
Both show up the same, as a broken image link with "Image Test" next to the symbol.
Jupyter Info:
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
notebook server is 4.2.3-da472a5
Julia Info:
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
System: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i5-4570 CPU # 3.20GHz
WORD_SIZE: 64
BLAS: libopenblas (NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: liblapack.so.3
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
IJulia 1.3.2
![Image Test](test.png) works fine for me; maybe it has to be in the same directory as the one where jupyter is running, i.e. the directory shown in the top-level Jupyter dashboard?
(Without using FileIO, you can also do display("image/png", read("file.png")).)
The ability to directly drag-and-drop or copy-paste images into notebook cells was recently added to Jupyter, so hopefully it will be in the next major release (Jupyter 4.3 or 5?).
The answer was to move all the files to my hard drive. The folder I was using was on a local network. Even then only relative directories worked with both markdown methods.
Despite knowing what to do I don't yet know why. If somebody could suggest why this might be I would appreciate it.
"(/notebooks/images/your_image.png)", this should work."notebooks" is just right after "localhost:xxxx/" in the search bar of your browser.
Before this, I've tried both relative and absolute file names too, but failed. It seems Jupyter Notebook(in my case, ipython 6.3.1) does not support loading local images from any other place but the same one as the ipynb. Hope this would help.
Related
I have installed Sage using the latest installer and I can open a Sage terminal (by clicking on it from the start menu...not by entering 'sage' in Windows command line).
I have then installed Anaconda. I can enter 'python' in Windows command line and it works. But the puzzling part is jupyter notebooks. By my understanding, it comes with Anaconda so, I should be able to open my Sage console and type some version of 'n jupyter' or 'njupyter' or '-n jupyter' etc to get a sage Jupyter notebook running.
This is NOT happening at all. Instead I get
Edit: I would like to get Sage to open a Jupyter notebook on my computer but the commands I tried (in the screenshot provided) just keep failing. I got a version of these commands from the Sage tutorial itself and still, it doesn't work.
Any suggestions on how to get this working are much appreciated.
The Sage-Windows installer installs three shortcuts for you:
"SageMath x.y" -- to use SageMath in the (Cygwin) command line
"SageMath x.y Notebook" -- to use SageMath in Jupyter
"SageMath x.y shell" -- to access a Cygwin terminal where Sage has not been started
Have you tried using the "SageMath 9.3 Notebook" shortcut?
See a guide at
https://wiki.sagemath.org/SageWindows
No problem in other directories. Is there an environmental variable or something else I need to erase?
Deleted cache file...
OK, I think I need be much clearer here.
First software:
MacOS Catalina 10.15.6
jupyter notebook 6.0.3
Python 3.8.3
IPython 7.16.1
jupyter notebook is installed and runs fine.
jupyter notebook runs just fine in any user directory on the computer except exactly one.
There is nothing obvious in this directory that shouldn't be there. An 'ls -al' shows nothing but some .py files.
I can create a jupyter notebook in this directory, but the kernel crashes and won't restart. I can rename the directory, rename the jupyter notebook, but the behavior persists beyond everything I have been able to reset including a cold computer restart. It is reproducible and happens every time.
This behavior is not seen in any other directory.
My question: are there environmental variables or caches stored not visibly in the directory (obviously) that are responsible for this incredibly annoying behavior and how can I reset them?
Problem solved: jupyter notebooks apparently uses some reserved names for local directory .py files when starting up the notebook. So far I've found that "string.py" and "decorator.py" cannot be in the startup directory unless they contain the expected data (looks like it needs to be related to some template info)
To start-up a kernel
You first activate your virtual environment:
For instance: conda activate vision
Second, you type jupyter notebook
as stated here
I am new to Jupyter Notebook --I am using Anaconda 3 with Windows 7 and Internet Explorer-- and I have been trying to paste text that I copied from a text file into a Jupyter notebook cell (I.e. some code). However when I right click my mouse, the pop-up window that appears does not list copy and paste options but rather the following:
Back
Search using copied text
Select all All
Accelerator
Create shortcuts
Add to favorites
View source
Inspect element
Encoding
Print
Print Preview
Refresh
Export to Excel
Send to One Note
Properties.
I have tried the shortcut control V and it does not work. Moreover, I tried opening the Jupyter Notebook with Chrome and again I don't see the copy - paste options.
I run the Jupyter notebook by typing 'ipython notebook' in Windows Commander.
So my question is: what should I do to paste text into my Jupyter Notebook cell?
Regarding the version of Jupyter Notebook:
About Jupyter Notebook
Server Information:
You are using Jupyter notebook.
The version of the notebook server is 4.3.1 and is running on:
Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]
Current Kernel Information:
R version 3.3.2 (2016-10-31)
Your advice will be appreciated.
The default R Notebook has a lot of prepopulated text. Is there a way to change this, so that when a new R Notebook is created, it is just a blank notebook?
On my machine (OSX) I can edit the template r_markdown_notebook.Rmd found at this location:
/Applications/RStudio.app/Contents/Resources/resources/templates
On Windows look inside the RStudio folder:
C:\Program Files\RStudio\resources\templates
On Ubuntu/Mint (Linux), you will need sudo:
/usr/lib/rstudio/resources/templates
I am using an Rstudio Server (0.98.490) on a CentOS machine, that uses the default installation in the machine which is an older version of R. I also have a newer version of R compiled elsewhere in the system. Can I, as a non-root user, tell Rstudio to use the new installation instead of the old one when I start a session?
I'm not sure if there are any peculiarities for CentOS, but I believe you should be able to change your ~/.profile or ~/.bash_profile file to include the following line: export RSTUDIO_WHICH_R=/path/to/desired/compiled/R.
You can see which version of R RStudio is currently running by entering which R into a terminal. the export command listed above should change it to your desired build.
These links might help:
https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R
Running newer version of R from terminal when older version is invoked by default
Hope this helps
The first answer was relevant RStudio, not rstudio-server as the question asks. The question is addressed in the section "RStudio Desktop and RStudio Server Open-Source".
However, adding a line like export RSTUDIO_WHICH_R=/usr/local/bin/R to my ~/.profile and ~/.bash_profile does not actually seem to affect rstudio-server for me. So I am giving up for now. The Pro version seems to have other options, as listed here.
Starting in RStudio Server 1.3 (newest version is 1.4.1106, released February 22, 2021), a user’s preferred version of R can be specified in the rstudio-prefs.json file in the global-level /etc/rstudio folder or in the user-level ~/.config/rstudio folder.
See https://blog.rstudio.com/2020/02/18/rstudio-1-3-preview-configuration/ and https://docs.rstudio.com/ide/server-pro/session-user-settings.html for user setting options in newer versions of RStudio Server.
See https://support.rstudio.com/hc/en-us/articles/200716783-RStudio-Release-History for RStudio release history and https://www.rstudio.com/products/rstudio/download-server/redhat-centos/ for Red Hat downloads of the newest version of RStudio Server.