Updating to a new dojo-env
- Click here for a web version of these instructions, with a table of contents sidebar.
- Click here for the web version of the Installation Overview.
If you just installedd your dojo-env for the first time, skip this step!
If you already have dojo-env installed on your computer, you must first rename it or remove it.
Note: these instructions are intended non-OS-specific. Your terminal may not look exactly like the examples in the screenshots (for example, the file paths for the environments will be very different). However, the steps are the same across all platforms.
Step 1: Rename or Remove Your Current dojo-env
To install the new dojo-env, you will need to remove your old dojo-env. However, depending on how long you've been using your current dojo-env, you may have installed additional packages that were not in the original dojo-env.
Note: if you are re-installing dojo-env as part of troubleshooting, you most likely will want to just Remove dojo-env, instead of renaming it.
Step 1.1) Confirm Which Conda Envs are Installed
- To display the currently installed environments, use the following conda env list command
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- If you see
dojo-env
in the list, you must either remove it or rename it before you can install the updated env.
Step 1.2) Deactivate dojo-env
In order to remove/rename an environment, it must be deactivated.
- Run the following command to deactivate the environment:
- If this command doesn't work correctly, use the following alternative command:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 1.3: Remove or rename your old dojo-env
You must remove your old dojo-env to install the new one. You may follow the next optional step if you'd like to keep a backup copy of your old env.
Note: if you are re-installing dojo-env as part of troubleshooting, you most likely will want to just Remove dojo-env, instead of renaming it.
Option A - Rename Your Old Dojo-env
Step 1.3.A.1) Run the conda rename command
If you want to keep a copy of your old dojo-env, you can rename it using the following conda rename
command:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
This command may take a few minutes to finish. It clones your old dojo-env and create a new clone of it called dojo-env-old, so it must go through the same installation steps.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Once the process has finished, run the
conda env list
command again to confirm that your env has been renamed and dojo-env no longer exists.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 1.3.A.2) Add The Renamed Env to Jupyter Notebook's Kernels
After the process has been completed, you will need to run the commands to activate the cloned environment and add it as a kernel in Jupyter Notebook.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
You're ready to install the new dojo-env!
Note: on how to use your renamed environment:
- To use your renamed old dojo-env:
- First, you must run the
conda activate dojo-env-old
command manually after starting your Terminal before starting jupyter notebook.
- Second, from within your Jupyter Notebook, you must click on Kernel > Change Kernel> and select "Python (dojo-env-old)"
Option B) Remove Your Old dojo-env
Alternatively, you could simply remove the environment instead of renaming it. This will delete all of the files associated with JUST our dojo-env
, it will not uninstall the Python distribution (Anaconda/miniforge).
Step 1.3.B.1) Run the conda remove command
- Remove old
dojo-env
using the command:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Enter
y
to approve the removal of the environment.
- Wait for the env to be removed.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Note: if you see the following message, you forgot to deactivate dojo-env (Step 12)
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Confirm the environment has been deleted using conda env list
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 1.3.B.2) Remove the old dojo-env kernel from Jupyter (Optional)
Note: if you are installing the new dojo-env you do not need to perform this step, as the new dojo-env will be installed in the same place as the old one.
- To check the list of Python kernels available in Jupyter Notebook, run the following comand:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- To remove a kernel from the list, run the following remove command to remove the dojo-env kernel, since that actual environment has been deleted:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 2: Get the updated dojo-env environment file
To install the new dojo-env, you will need to download the updated environment.yml file from the dojo-env-setup repository.
Step 2.1 Open the dojo-env-setup repo in GitHub Desktop.
-
Open the dojo-env-setup repo in GitHub Desktop again.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 2.2) Discard any changes to the dojo-env-setup repo
To avoid git conflicts when pulling the updated repository, you must first discard any changes you've made to files in the dojo-env-setup repo.
-
Discard any changes to files that appear on the left sidebar
-
Make sure all changed files are checked.
-
Right-click on the top of the changes view (see screenshot below)
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Then select "Discard All Changes"
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 2.3) Update your local copy of the repo
- Click on the "Fetch Origin" button in the top right corner of GitHub Desktp
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
GitHub Desktop will check for new commits to the repository.
If there are any, an arrow will appear, and the button will change to "Pull Origin".
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Click the "Pull Origin" button to get the updated repo/environment.
You're ready to re-create the dojo-env!
Step 3) Recreate dojo-env with conda env create
- Open the dojo-env-setup repo in your Terminal.
Repeat the steps from the original instructions in Step 2.3:
- Run the correct command for your OS:
Windows:
Macs with Intel Processors:
Macs with Appel Chips:
Troubleshooting conda env create: "Prefix already exists"
Problem:
- You receive an error when you attempt to re-create the dojo-env that says
"CondaValueError: previx already exists {filepath to env}"
like the screenshot below
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Cause:
- The folder for the old dojo-env was not fully deleted by
conda remove
or conda rename
your old dojo-env's folder was not fully deleted.
Solutions:
- Check the
conda env list
command again to determine which solution to use.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Confirm the New dojo-env Works
- Start Jupyter Notebook and run the environment tester notebook for your operating system to confirm your installation was a success!
Appendix
Activating dojo-env is still the default, but it no longer exists
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- The command to
conda activate dojo-env
is still in terminal's settings file.
- Manually open the correct file for your Terminal and remove the conda activate command.
- Windows:
/c/Users/<your-username/.bash_profile
- Mac (bash):
/Users/<your-username>/.bash_profile
- Mac (zsh):
/Users/<your-username>/.zshrc
- After removing the conda activate command, save the file and close it.
- Open a new terminal window. You should no longer see that message.
Backup Your Env/Export Your Env to a .yml file
Instead of renaming your old env, you could export your current dojo-env to a new .yml file, just like the original dojo-env
environment file.
- To export your environment to a file called "my-old-environment.yml" in your User folder, run the command:
- To re-create the environment, you would run:
Step 2.1) Delete your old dojo-env-setup repo (if git has merge conflicts)
To avoid merge conflicts when pulling the updated repository, you should remove your old clone of the dojo-env-setup repo and then clone it again.
-
In GitHubDesktop, switch to the dojo-env-setup repository in the Current Repo drop down menu (top left). Once you're in dojo-env-setup, click on the "Repository" menu and select "Remove" > check Move to Trash/Recycle Bin.
-
Navigate to the dojo-env-setup repo: https://github.com/coding-dojo-data-science/dojo-env-setup
-
Clone the Repository to Your Computer:
- Click the green Code button and select "Open in GitHub Desktop. "
- If you still have your previously cloned copy, GitHub Desktop should show a # and down arrow on the top right corner where it should say "Fetch Origin".
- Press the button to "Fetch Origin", which will download the updated environment files.
- You may need to press it again if it changes to "Pull Origin"
- If you've updated the repo successfully there should be no remaining #'s or arrows on the top right corner.
- If so, click on the Repository menu > Open in Terminal (or Open in GitBash).