Access a saved ipython notebook on an external drive (mac) - macos

I'm trying to access an ipython notebook that was saved to an external HD. Is this possible?
Specifically, I saved an ipython notebook to a dropbox folder (locally synced) on one computer. I am now trying to open that ipython notebook on another computer that syncs to the same dropbox account -- only computer b's dropbox folder is on an external HD.
This seems so basic, but I've looked everywhere for an answer on this and am afraid I'm missing something more fundamental here.

Create a symbolic link to your external drive; store this link somewhere on the main drive.
For example, my Dropbox folder is on an external flash card, so I used a terminal session to do the following:
$ ln -s /Volumes/SDCARD/Dropbox ~/Documents/DB
(Screenshots here)

From terminal, if you have Anaconda installed, type:
jupyter notebook --notebook-dir=/Volumes/NameofExternalDrive

Related

anaconda - ipynb file not opening after been saved on windows pc

actually a novice here but recently installed the anaconda distribution and lunched the jupyter notebook. tried running few operations and saved on desktop, after sometimes, I tried clicking on the file saved on desktop but it isn't opening. my question is-> is there a particular type of file to save you IPYNB. operation on with windows? or rather save IPYNB file on windows system.

Jupyter Notebook Cannot Access Desktop Files and Folders

I recently bought a new M1 Pro Macbook with macOS Monterey. Migrated all my stuff from my previous Macbook Air over to it.
I opened my Jupyter Notebook via Anaconda but now, it cannot detect my Desktop files and folders (the Desktop folders are on the extreme right of the screenshot):
I have also went to System Preferences -> Security & Privacy -> Privacy -> Files and Folders to check on the access and permissions, but nothing seems amiss:
Attaching the Jupyter terminal boot-up here as well just for reference:
Can anyone assist? Thank you!
Jupyter can't cd outside of your Users/user path. However, you can change that folder in the jupyter_notebook_config.py. Look for the c.NotebookApp.notebook_dir entry to point to the desired working directory. You can create this config file from your shell via
jupyter notebook --generate-config
Small configuration is required to view these files on jupyter notebook.
Get the path of jupyter_notebook_config.py file.
Below mentioned command can be used to find it -
jupyter notebook --generate-config
open the file and search for c.NotebookApp.notebook_dir
this might be configured to default value i.e. ''
Reconfigure it and update path of directory contain code files,
like -
c.NotebookApp.notebook_dir = /Volumes/Technical/Python

Access external drive over ssh on MacOS

I have a new M1 iMac with a 4TB external (USB) drive attached. On the iMac I can access the contents of that drive, named "Data" at /Volumes/Data.
I use ssh to remotely access this iMac, and would like to be able to access the contents of /Volumes/Data. However, when I try I get "Operation not permitted".
I have gone into System Preferences, under Security & Privacy, and added Terminal, iTerm2, and bash (/opt/homebrew/bin/bash) to the list under Full Disk Access. This is mirrored automatically in Files and Folders. I've also added the same items to Developer Tools. All to no avail, I still get the "Operation not permitted" error when trying to do a cd or ls command against /Volumes/Data.
Some of my search results have suggested turning SIP off. I am reluctant to do this unless absolutely necessary.
I did try running chflags -R nouchg . in /Volumes/Data while on the iMac, but that also didn't resolve the issue.
Moving the external drive to a MacBook Pro (I.e., an Intel-based architecture) allows the contents of the external drive to be accessed remotely. The "Operation not permitted" error only happens when the external drive is attached to an M1-based Mac.
Is there a setting or preference that I've missed that will permit remote access to external hard drives on an M1-based Mac?

How to change the windows drive for JupyterLab in Anaconda Navigator?

Under Windows, JupyterLab does not allow navigation in the UI to any drive other than the drive that JupyterLab was started in. By default this is the C: drive.
How can you access notebooks on another drive?
Anaconda does not allow switching between drives but you can start Jupyter Lab or a Jupyter notebook on another drive, for example the D: drive.
First shutdown any running JupyterLab, then
Open a terminal window from within Anaconda Navigator. To do this, select environments in the Navigator window and then click the green "play" arrow next to base(root) -- or which ever environment you are using.
then in the terminal window type
jupyter notebook --generate-config
this will generate a file in your user directory under .jupyter\jupyter_notebook_config.py
edit the file.
Set the variable c.NotebookApp.notebook_dir to whatever directory you want to start in, for example
c.NotebookApp.notebook_dir = "D:\mydir"
NOTE do not put a trailing backslash. Also if the directory pathname contains spaces ensure you are using double quotes.
save the file and test that all is working. In the command line type
jupyter lab
this should start JupyterLab correctly, check for any errors in the terminal window. JupyterLab should start in the directory you set in the file.
If all is well, shutdown JupyterLab and run it from the Anaconda Navigator window as usual. All should work now.
As mentioned by GreyMS in this github issue, you can use an mklink:
mklink /D D_Drive D:\sources

Store Docker image files on external drive in macOS

I'm using a Mac Book Pro with 128Gb disk. Is there any way to have the Docker images be stored on an external hard drive rather than on the Mac's main drive?
I don't have that much free space, and can't afford to remove any installed software. Ideally I'd like to have Docker fetch the images from an external drive. Can this be done using a symlink?
Eventually figured out that docker can use a symlink. In a macOS setup the file that I want to place in an external drive is located at:
~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/
and is named
Docker.qcow2
Just move the file to an external disk drive (for instance) and create a symlink pointing to the new location.
Please create a symlink to your desired external drive location:
create a symlink from ~/Library/Containers/com.docker.docker to your external drive location
EHOME=/Volumes/<your-external-drive-name>
ln -s $EHOME/Library/Containers/com.docker.docker ~/Library/Containers/com.docker.docker
I was able to get this working and documented it here:
This tutorial will explain how to setup an external disk to store docker images and containers.
https://github.com/09wattry/run-docker-external-storage
It is basically a symlink to the folders mentioned.

Resources