- Install Ubuntu from the Windows Store
- Setup changing the default opening directory (based on this)
- Open Ubuntu
sudo vim /etc/passwd
- Type "i" to enter the insert mode so we can make changes
- Find your account's line, should start with your username. Eg mine was
muellerzr:x:1000
,:home/muellerzr/:bin/bash
- We care about changing the /home part. Change it to
/mnt/c
to use the "C" drive,/mnt/d
to use the "D" drive, and so forth - Save our changes with
:wq
and enter
- Exit and relaunch bash, this will now start where we want to
Editors Note: I made a jupyter folder and pointed mine to start there
-
Installing Anaconda3 (Based on these instructions)
- Download this image of Anaconda3
- If working from a particular mnt drive, create your "jupyter" folder now. This is where we will install Anaconda and work out of
- From the terminal run
sudo bash Anaconda3-2019.03-Linux-x86_64.sh
.
Editors Note: I have to include
sudo
on everything, due to read/write access for the D drive specifically and Ubuntu Subsystem. No solution yet.- Read the licence agreement, and follow the prompts to accept.
- When it asks for an install/save directory, do not keep the defaults. Instead have it point to your
jupyter
folder we made. (this is relative to the install location for the most part) - When it asks if you'd like the installer to prepend the path, say yes
- To confirm it worked, close the terminal and then run
which python
. It should print the python version. If it does not, we need to manually add it to the path a.vim ~/.bashrc
b. Pressi
c. AddPATH=/mnt/d/jupyter/anaconda3/bin:$PATH
d. This should point to your install directory of jupyter/anaconda3 - Finally, to have
python
work aspython3
, I didsudo apt install python-is-python3
. Afterwardswhich python
showed python3 by default
-
Next, we need to install Jupyter and pypi. I changed the default installation of pypi packages to also be on my "D" drive, as it has more space and is an SSD
-
Change the install location of pypi packages
- First update apt with
sudo apt update
- Then install
python3-pip
withsudo apt install python3-pip
- Next, make a
dist-packages
directory inD:/jupyter/anaconda3
- Run
pip config set global.target jupyter/anaconda3/dist-packages
Editors Note: I'm yet to figure out how to tell pypi to download the Wheels file to here, more updates on this later
- I then also copied the contents of
dist-packages
originally and moved it over to our new one:sudo mv /usr/local/lib/python3.8/dist-packages/*
D:/jupyter/anaconda3/dist-packages*
- First update apt with
-
Installing Jupyter
- Finally I had to reinstall jupyter, as the original jupyter package wasn't stored in the right location and there were some symlink issues
sudo pip install uninstall jupyter-notebook
sudo rm -r /usr/local/lib/python3.8/dist-packages
sudo pip install jupyter-notebook
sudo pip install jupyterlab
-
Finally, a Conda environment based on this
- For my purposes I did
conda create --name ENV_NAME
but you just replace "ENV_NAME" with any name. You don't need to specify a python version, it will automatically use our default installed python3 - Finally do
conda activate ENV_NAME
before moving onto step 9
- For my purposes I did
-
Now we can start our server! In order to give Jupyter read/write access, we need to start our server with:
sudo nohup jupyter notebook --port=8887 --allow-root > jupyter.log 2>&1 & echo $! > save_pid.txt
-
Your server is now up! Simply copy the key and go to
localhost:8887
to gain access
Important Note:
To fix the sudo issue, move your location of the installed Ubuntu to the drive you're working on.
I followed the directions here: https://superuser.com/questions/1113906/can-i-move-the-linux-subsystem-to-a-different-drive
Note: The distribution name in this instance is
Ubuntu
rather thanUbuntu-18.04