You may have created a conda environment with specific versions of dependencies needed to run your script. What happens when you need to run this script on another computer?
You can simply export the environment in a .yml file and use that file to recreate the original conda environment on another computer. That way you will not have to individually install all of the dependencies.
On the original computer:
Step 1: Export your environment as a .yml file.
conda env export > environment.yml
Step 2: Make the file accessible on the other computer.
On the other computer:
Step 1: If you have not done so already, download Anaconda.
Step 2: Open the Anaconda Prompt from the Start Menu.
Step 3: Create a new project directory.
mkdir project
Step 4: cd into the project directory
cd project
Step 5: Place dataset and script files in the project directory.
Step 6: Create the environment from the .yml file.
conda env create -f environment.yml
Step 7: Now you can run the script in the Anaconda Prompt. If you closed the command prompt after step 6, make sure to first reactivate the environment using conda activate environment.
If your script is contained in a jupyter notebook, run jupyter notebook in the command prompt and then open the .ipynb file in the browser window that pops up.
If you already have an environment with the same name as the .yml file, rename the .yml file and the name inside the file (after ‘name:’) before creating the environment.