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

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.

Related

Open Linux subsystem directory v.s. raw Windows directory in VS Code?

I want to open a WSL directory in VS Code. What's the difference between the following two methods and which should I use?
First method, open WSL window. It's common.
Second method, directly open directory and select the directory in wsl$ path.
Visual Studio Code recognize better the Connection than opening it directly
In most cases, you'll want to use the "New WSL Window" (or its equivalent). This utilizes the "Remote - WSL" extension to connect to your WSL instance through a small server that it installs in your WSL user's home directory. You'll probably find it already installed in your case in ~/.vscode-server.
This server handles the "translation" between the Windows VSCode and the Linux files, folders, and processes.
An easy way to think about the difference between the two methods of opening a folder:
Using "New WSL Window" puts VSCode in "WSL/Linux" mode
Using "Open Folder" and opening \\wsl$\... directly keeps VSCode in "Windows mode".
Comparing the two techniques with a real file. I have a simple Python file in my WSL home directory that I wrote up for another answer a few days ago. If I:
Open my home directory through \\wsl$\ in VSCode, then the VSCode Python extension complains:
Python is not installed. Please download and install Python before using the extension.
Since I don't have the Windows version of Python installed, and VSCode is operating in "Windows mode", it can't find the Linux/WSL Python interpreter.
However, if I:
Open my home directory through "Remote-WSL: New WSL Window", then open my Python file, then VSCode finds my Python interpreter, and I can run and debug the file in WSL through VSCode.
Side note #1: There is another method that has the same effect as using the command palette's "New WSL Window" -- From inside a WSL directory, run code .
Side note #2: There may be times when you want to open a file that lives inside WSL in "Windows mode". You may want to run it in a Windows version of a tool (Python, Java, whatever) to check compatibility.
As a general rule of thumb, however, you should probably do your Linux development with files inside WSL using VSCode's "WSL Mode" and Windows development with files that live on a Windows drive using "Windows (a.k.a. normal) mode".

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

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

open ipython notebook with firefox

I'm using Windows 10 and my default browser is Chrome. If I go to the Firefox directory (C:\Program Files (x86)\Mozilla Firefox) and open the command prompt and type:
ipython notebook --browser='firefox'
then the notebook opens as expected. However if I navigate to the folder which contains my files and try to do something like:
ipython notebook --browser='C:\Program/Files/(x86)\Mozilla/Firefox\firefox'
then it does not launch. The error is "No web browser found: could not locate runnable browser". I have tried many variations of this with no success. This was brought up in a similar thread a couple years ago (Launch IPython notebook with selected browser) with no resolution that I could see.

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

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

Resources