setup fast.ai git repo and python venv
fork the fast.ai github repo to your personal account.
then git clone from your github repo to your EC2 server.
copy the git repo url into your shell
git clone https://github.com/<your-github-name>/fastai.git
NB: should setup your github and git to use ssh instead of https.
a few useful commands.
#check url current git repo belongs to
git remote show origin
#alt method
#git config --get remote.origin.url
Part 1 (version 2) > https://github.com/fastai/fastai/tree/master/courses/dl1
We need to follow the setup instructions to install the python packages needed and configure the python virtual environment.
#cd to directory containing your forked repo of the fast ai repo.
cd fastaiconda env update
This will start installing the conda env configured
This will take a while to run as there are hundreds of packages to be configured.
Eventually.
following the instructions on https://github.com/fastai/fastai
conda activate fastai
results in this error below.
to check we are in a bash shell (by default most *nix OS will be)
echo $0
The current .bashrc file looks like this.
to add conda for all users, create the softlink as below.
sudo ln -s /home/ec2-user/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh
After creating the softlink we can see the following.
need to add ‘conda activate’ to the end of the ~/.bashrc file
echo "conda activate" >> ~/.bashrc
looking at ~/.bashrc again we can see ‘conda activate’ added to last line.
the error message tells us we need to delete this line from ~./bashrc
export PATH="/home/ec2-user/anaconda3/bin:$PATH"
looking at the ~/.bashrc we delete the line.
export PATH=$HOME/anaconda3/bin/:$PATH
Now the ~/.bashrc file looks like this.
Now we need to exit the shell and ssh in again for the changes to ~/.bashrc to take effect.
Due to the last line in ~/.bashrc activating conda we are launched into the (base) virtual environment and the bash prompt looks like this.
(base) [ec2-user@ip-172-31-34-17 ~]$
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -
If this message is experienced, do the update as suggested.
pip install --upgrade pip
code.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
I experienced this weird and unusual error message. Probably the result of terminating and launching instances in rapid succession and re-using a previous ip number. [sha key deleted.]
to fix, edit the .ssh/known_hosts file as directed. I found it easier to delete the line(s) with corresponding ip numbers rather than editing. The ssh protocol will detect the ip number has not been previously recognised and add the new sha code.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —