make sure it's in the same reigon in the same VPC as your EC2. Furthermore, your EFS also has to be in the same Security Group (with NFS access)
follow this guide on how to mount your EFS on to a new EC2 instance
you can double check that it's mounted by df -h
or mount | grep efs
your newly launched EC2 instance should have the EFS mount instructions in /etc/fstab
for instructions on how to mount the EFS manually see here
Once the EFS is mounted you'll need to change permissions to add files:
cd ~/efs-mount-point
sudo chmod go+rw .
If things failed, check here
find your pip install cache dir:
pip cache dir
which usually is at ~/.cache/pip
. You can then create a symlink of it to a location on your EFS
First create a symlink to your mount point in your home directory:
cd ~
ln -s /mnt/efs/fs1 efs-store
then just add this to your ~/.bashrc
:
# Python VirtualEnvWrapper
export WORKON_HOME=$HOME/efs-store/.virtualenvs
export PROJECT_HOME=$HOME/efs-store/Devel
export VIRTUALENVWRAPPER_PYTHON=~/anaconda3/bin/python
source /home/ubuntu/anaconda3/bin/virtualenvwrapper.sh
alias mkvirtualenv3='mkvirtualenv --python=`which python3` '
Then virtualenvwrapper
will build all virtualenv on your EFS