From 5b2589b872df827f151a6b84cbb4b54f3752cdc6 Mon Sep 17 00:00:00 2001 From: Yanke Mao Date: Tue, 19 Mar 2024 20:49:56 -0400 Subject: [PATCH 1/8] Create an additional intrpduction files about the tasks of conda. Specifically, introduced the basic guidelines for managing conda, managing environment. managing channels. and managing packages with Conda. --- .../Development_Process/Conda/Tasks_Conda.md | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 Topics/Development_Process/Conda/Tasks_Conda.md diff --git a/Topics/Development_Process/Conda/Tasks_Conda.md b/Topics/Development_Process/Conda/Tasks_Conda.md new file mode 100644 index 000000000..a75a860e0 --- /dev/null +++ b/Topics/Development_Process/Conda/Tasks_Conda.md @@ -0,0 +1,213 @@ +## Managing Conda + +Managing Conda effectively is crucial for maintaining the integrity and functionality of your Conda environment. Regular updates ensure you have the latest features and security updates, while understanding how to check and manage its version can help troubleshoot any issues that may arise. These commands are an essential part of using Conda for managing Python environments, especially in environments where consistent and reproducible setups are important. + +### Verifying Conda Installation + +- Command: `conda --version` +- This command should return the version of Conda installed. If it doesn't, ensure you are logged into the correct user account, are in a directory Conda can find, and have reopened the terminal after installation. + +### Determining Conda Version + +- Commands: `conda info` or `conda -V` +- Both commands provide details about the installed version of Conda. + +### Updating Conda + +- Command: `conda update conda` +- This command will check for the latest version of Conda and prompt you to update ('y' to proceed with the update). It also informs about other packages that will be updated or changed as a result of the Conda update. + +### Suppressing Warning Messages About Conda Updates + +- Command to Suppress Warnings: `conda config --set notify_outdated_conda false` +- This command stops Conda from displaying warnings about newer versions being available. +- Alternatively, you can manually add `notify_outdated_conda: false` to your `.condarc` file. + +For more comprehensive guidance, refer to the official documentation on [Managing Conda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-conda.html). + +## Managing environments + +### Creating Environments: + +- Basic creation: `conda create --name ` +- With a specific Python version: `conda create -n myenv python=3.9` +- Including specific packages: `conda create -n myenv scipy` or `conda install -n myenv scipy` +- With specific package versions: `conda create -n myenv scipy=0.17.3` +- Combining Python version and multiple packages: `conda create -n myenv python=3.9 scipy=0.17.3 astroid babel` + +### Environment File: + +- Create an environment from environment.yml: `conda env create -f environment.yml` +- Activate the new environment: `conda activate myenv` +- Verify the environment: `conda env list` or `conda info --envs` + +### Specifying Environment Location: + +- Create an environment in a specific directory: `conda create --prefix ./envs jupyterlab=3.2` +- Activate with: `conda activate ./envs` +- Modify .condarc for a custom prompt + +### Updating an Environment: + +- Update based on changes in environment.yml: `conda env update --file environment.yml --prune` + +### Cloning an Environment: + +- Clone an existing environment: `conda create --name myclone --clone myenv` + +### Building Identical Environments: + +- Generate a spec file: `conda list --explicit > spec-file.txt` +- Create an environment from a spec file: `conda create --name myenv --file spec-file.txt` + +### Activating an Environment + +- Purpose: Adds environment entries to PATH and runs activation scripts, setting necessary environment variables. +- Command: `conda activate myenv` (replace myenv with your environment name). +- Windows Specifics: Due to its reliance on a dynamic-link library search order, proper activation on Windows is crucial to avoid errors like HTTP or SSL issues. + +### Conda Init + +- Background: Introduced in Conda 4.4, improved in Conda 4.6 to support a variety of shells (bash, zsh, csh, fish, xonsh). +- Key Feature: Allows the use of conda activate without modifying the PATH, reducing disruptions to other software. +- Auto-activation of Base Environment: Can be controlled via the auto_activate_base setting. + +### Nested Activation + +- Usage: `conda activate --stack myenv` to retain current environment in the PATH. +- Auto-Stacking: Configurable for automatic stacking when moving from outermost (base) environment. + +### Environment Variables for DLL Loading + +- Warning: Without activation, environment variable setting and script activations don't occur. Full support is only for activated environments. + +### Deactivating an Environment + +- Command: `conda deactivate` to remove the path of the current active environment. +- Note: From the base environment, use `conda activate` to return to the base instead of `conda deactivate`. + +### Determining Your Current Environment + +- Indication: Active environment shown in parentheses or brackets at the beginning of the command prompt. +- Checking Environment: `conda info --envs` shows a list with the current environment marked. +- Prompt Display Setting: Can be toggled with `conda config --set changeps1 false/true`. + +### Viewing a List of Your Environments + +- Command: `conda info --envs` or `conda env list` to see all environments. +- Administrator View: Shows all environments for all users if run by an administrator. + +### Viewing a List of Packages in an Environment + +- For a Non-Activated Environment: `conda list -n myenv` +- For an Activated Environment: `conda list` +- To Check for a Specific Package: `conda list -n myenv scipy` + +### Using Pip in an Environment + +- It's recommended to use Conda before Pip within environments for package installation. +- Using Pip after Conda helps avoid potential dependency conflicts. +- Creating isolated Conda environments for Pip usage is advised. +- If you need to make significant changes after using Pip, recreate the Conda environment. + +### Setting Environment Variables +- `conda env config vars set` and `unset` commands are used to manage environment variables. +- Set environment variables are specific to each Conda environment and are removed upon deactivation. + +### Saving Environment Variables + +- Scripts can be written to automatically set and unset environment variables upon activation and deactivation of an environment. +- Different scripts are used for Windows (`env_vars.bat`) and UNIX-like systems (macOS and Linux, `env_vars.sh`). + +### Sharing an Environment + +- Environments can be shared via an `environment.yml` file, which lists all packages and versions. +- The `conda env export > environment.yml` command is used to create this file. +- For cross-platform compatibility, `conda env export --from-history` includes only explicitly requested packages. + +### Restoring an Environment + +- `conda list --revisions` shows the history of changes made to the environment. +- Environments can be restored to previous states using `conda install --revision=REVNUM`. + +### Removing an Environment + +- Environments are removed with `conda remove --name myenv --all` or `conda env remove --name myenv`. +- The removal can be verified using `conda info --envs`. + +For more comprehensive guidance, refer to the official documentation on [Managing Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). + +## Managing Channels + +### Conda Channels + +- What They Are: Channels are the locations (URLs) where Conda packages are stored. +- Default Behavior: By default, Conda searches a set of default channels and downloads/updates packages from there. +- Channel Collisions: These occur when multiple channels host the same package. Conda has ways to resolve these collisions. + +### Channel Priority + +- Default Priority Resolution: Conda prioritizes packages based on the channel priority (higher priority channels are preferred), then by version number, and finally by build number within each channel. +- Strict Channel Priority: This mode, available from Conda 4.6.0 onwards, ensures that packages in lower priority channels are not considered if the same package is available in a higher priority channel. It speeds up operations and reduces package incompatibility issues. +- Flexible Channel Priority: This is the default setting where Conda can reach into lower priority channels to fulfill dependencies if necessary. +- Disabled Channel Priority: Here, the package version takes precedence, and channel priority only breaks ties. + +### Configuring Channel Priority + +- Setting Strict Priority: Use conda config --set channel_priority strict. +- Disabling Channel Priority: Add channel_priority: disabled in the .condarc file or use conda config --set channel_priority disabled. +- Adding Channels: Use conda config --add channels new_channel to add a channel to the top (highest priority) or conda config --append channels new_channel for the bottom (lowest priority). + +### Practical Implications + +- No Collisions with Defaults Only: Using only the defaults channel prevents collisions. +- Prioritizing Channels: The order of channels in your configuration affects how packages are resolved, especially when multiple channels offer the same package. +- Using Strict Priority: This is recommended for faster operations and fewer incompatibility problems, but it might limit the availability of certain packages if they're only found in lower-priority channels. + +For more comprehensive guidance, refer to the official documentation on [Managing Channels](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html). + +## Managing Packages + +### Searching for Packages + +- Basic Search: `conda search packageName` to check if a package is available. +- Search in Specific Channel: `conda search --override-channels --channel channelURL packageName` for searching in a particular channel. + +### Installing Packages + +- Basic Installation: `conda install packageName` to install a package in the current environment. +- Specific Environment Installation: `conda install --name envName packageName` to install in a specified environment. +- Version-Specific Installation: `conda install packageName=versionNumber` for installing a specific version. +- Multiple Packages: `conda install packageName1 packageName2` to install multiple packages simultaneously. +- Packages from Anaconda.org: Use `conda install -c channelName` packageName for packages available on Anaconda.org but not in the default channels. +- Non-Conda Packages: If a package isn't available through conda, it can be installed via `conda-forge` or `pip`. + +### Updating Packages + +- Update Specific Package: `conda update packageName`. +- Update Python: `conda update python` updates to the latest in the current series (e.g., Python 3.7 to Python 3.8). +- Update Conda: `conda update conda`. +- Update Anaconda Metapackage: `conda update anaconda`. + +### Preventing Package Updates (Pinning) + +- Pinning Packages: Prevent specific packages from updating by adding them to a `pinned` file in the `conda-meta` directory of the environment. + +### Setting Default Packages for New Environments + +- Default Packages: `conda config --add create_default_packages packageName` to automatically install certain packages in every new environment. + +### Removing Packages + +- Remove Specific Package: `conda remove -n envName packageName` from a specific environment, or `conda remove packageName` from the current environment. +- Multiple Packages: `conda remove packageName1 packageName2` to remove multiple packages at once. + +### Listing Installed Packages + +- List Packages: `conda list` to view packages installed in the current environment, or `conda list -n envName` for a different environment. + +### Finding Package Dependencies + +- To find what packages depend on a specific package, use a combination of `conda search` and file searching in the Conda package cache. + +For more comprehensive guidance, refer to the official documentation on [Managing Packages](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html). From cf9ba723eb65a98b635341847497ef6688465392 Mon Sep 17 00:00:00 2001 From: Yanke Mao Date: Tue, 19 Mar 2024 21:53:24 -0400 Subject: [PATCH 2/8] Split the original file into four separate files, each file with a task type; add a high-level description of each task. --- .../Conda/Managing_channels.md | 31 +++ .../Conda/Managing_environments.md | 113 ++++++++++ .../Conda/Managing_packages.md | 48 ++++ .../Conda/Manging_Conda.md | 27 +++ .../Development_Process/Conda/Tasks_Conda.md | 213 ------------------ 5 files changed, 219 insertions(+), 213 deletions(-) create mode 100644 Topics/Development_Process/Conda/Managing_channels.md create mode 100644 Topics/Development_Process/Conda/Managing_environments.md create mode 100644 Topics/Development_Process/Conda/Managing_packages.md create mode 100644 Topics/Development_Process/Conda/Manging_Conda.md delete mode 100644 Topics/Development_Process/Conda/Tasks_Conda.md diff --git a/Topics/Development_Process/Conda/Managing_channels.md b/Topics/Development_Process/Conda/Managing_channels.md new file mode 100644 index 000000000..c05c57508 --- /dev/null +++ b/Topics/Development_Process/Conda/Managing_channels.md @@ -0,0 +1,31 @@ + +## Managing Channels + +Information about channels and how they are searched through when installing packages + +### Conda Channels + +- What They Are: Channels are the locations (URLs) where Conda packages are stored. +- Default Behavior: By default, Conda searches a set of default channels and downloads/updates packages from there. +- Channel Collisions: These occur when multiple channels host the same package. Conda has ways to resolve these collisions. + +### Channel Priority + +- Default Priority Resolution: Conda prioritizes packages based on the channel priority (higher priority channels are preferred), then by version number, and finally by build number within each channel. +- Strict Channel Priority: This mode, available from Conda 4.6.0 onwards, ensures that packages in lower priority channels are not considered if the same package is available in a higher priority channel. It speeds up operations and reduces package incompatibility issues. +- Flexible Channel Priority: This is the default setting where Conda can reach into lower priority channels to fulfill dependencies if necessary. +- Disabled Channel Priority: Here, the package version takes precedence, and channel priority only breaks ties. + +### Configuring Channel Priority + +- Setting Strict Priority: Use conda config --set channel_priority strict. +- Disabling Channel Priority: Add channel_priority: disabled in the .condarc file or use conda config --set channel_priority disabled. +- Adding Channels: Use conda config --add channels new_channel to add a channel to the top (highest priority) or conda config --append channels new_channel for the bottom (lowest priority). + +### Practical Implications + +- No Collisions with Defaults Only: Using only the defaults channel prevents collisions. +- Prioritizing Channels: The order of channels in your configuration affects how packages are resolved, especially when multiple channels offer the same package. +- Using Strict Priority: This is recommended for faster operations and fewer incompatibility problems, but it might limit the availability of certain packages if they're only found in lower-priority channels. + +For more comprehensive guidance, refer to the official documentation on [Managing Channels](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html). diff --git a/Topics/Development_Process/Conda/Managing_environments.md b/Topics/Development_Process/Conda/Managing_environments.md new file mode 100644 index 000000000..2becea6ba --- /dev/null +++ b/Topics/Development_Process/Conda/Managing_environments.md @@ -0,0 +1,113 @@ +## Managing environments + +Various operations involved with creating, updating, exporting, and removing environments, plus more + +### Creating Environments: + +- Basic creation: `conda create --name ` +- With a specific Python version: `conda create -n myenv python=3.9` +- Including specific packages: `conda create -n myenv scipy` or `conda install -n myenv scipy` +- With specific package versions: `conda create -n myenv scipy=0.17.3` +- Combining Python version and multiple packages: `conda create -n myenv python=3.9 scipy=0.17.3 astroid babel` + +### Environment File: + +- Create an environment from environment.yml: `conda env create -f environment.yml` +- Activate the new environment: `conda activate myenv` +- Verify the environment: `conda env list` or `conda info --envs` + +### Specifying Environment Location: + +- Create an environment in a specific directory: `conda create --prefix ./envs jupyterlab=3.2` +- Activate with: `conda activate ./envs` +- Modify .condarc for a custom prompt + +### Updating an Environment: + +- Update based on changes in environment.yml: `conda env update --file environment.yml --prune` + +### Cloning an Environment: + +- Clone an existing environment: `conda create --name myclone --clone myenv` + +### Building Identical Environments: + +- Generate a spec file: `conda list --explicit > spec-file.txt` +- Create an environment from a spec file: `conda create --name myenv --file spec-file.txt` + +### Activating an Environment + +- Purpose: Adds environment entries to PATH and runs activation scripts, setting necessary environment variables. +- Command: `conda activate myenv` (replace myenv with your environment name). +- Windows Specifics: Due to its reliance on a dynamic-link library search order, proper activation on Windows is crucial to avoid errors like HTTP or SSL issues. + +### Conda Init + +- Background: Introduced in Conda 4.4, improved in Conda 4.6 to support a variety of shells (bash, zsh, csh, fish, xonsh). +- Key Feature: Allows the use of conda activate without modifying the PATH, reducing disruptions to other software. +- Auto-activation of Base Environment: Can be controlled via the auto_activate_base setting. + +### Nested Activation + +- Usage: `conda activate --stack myenv` to retain current environment in the PATH. +- Auto-Stacking: Configurable for automatic stacking when moving from outermost (base) environment. + +### Environment Variables for DLL Loading + +- Warning: Without activation, environment variable setting and script activations don't occur. Full support is only for activated environments. + +### Deactivating an Environment + +- Command: `conda deactivate` to remove the path of the current active environment. +- Note: From the base environment, use `conda activate` to return to the base instead of `conda deactivate`. + +### Determining Your Current Environment + +- Indication: Active environment shown in parentheses or brackets at the beginning of the command prompt. +- Checking Environment: `conda info --envs` shows a list with the current environment marked. +- Prompt Display Setting: Can be toggled with `conda config --set changeps1 false/true`. + +### Viewing a List of Your Environments + +- Command: `conda info --envs` or `conda env list` to see all environments. +- Administrator View: Shows all environments for all users if run by an administrator. + +### Viewing a List of Packages in an Environment + +- For a Non-Activated Environment: `conda list -n myenv` +- For an Activated Environment: `conda list` +- To Check for a Specific Package: `conda list -n myenv scipy` + +### Using Pip in an Environment + +- It's recommended to use Conda before Pip within environments for package installation. +- Using Pip after Conda helps avoid potential dependency conflicts. +- Creating isolated Conda environments for Pip usage is advised. +- If you need to make significant changes after using Pip, recreate the Conda environment. + +### Setting Environment Variables +- `conda env config vars set` and `unset` commands are used to manage environment variables. +- Set environment variables are specific to each Conda environment and are removed upon deactivation. + +### Saving Environment Variables + +- Scripts can be written to automatically set and unset environment variables upon activation and deactivation of an environment. +- Different scripts are used for Windows (`env_vars.bat`) and UNIX-like systems (macOS and Linux, `env_vars.sh`). + +### Sharing an Environment + +- Environments can be shared via an `environment.yml` file, which lists all packages and versions. +- The `conda env export > environment.yml` command is used to create this file. +- For cross-platform compatibility, `conda env export --from-history` includes only explicitly requested packages. + +### Restoring an Environment + +- `conda list --revisions` shows the history of changes made to the environment. +- Environments can be restored to previous states using `conda install --revision=REVNUM`. + +### Removing an Environment + +- Environments are removed with `conda remove --name myenv --all` or `conda env remove --name myenv`. +- The removal can be verified using `conda info --envs`. + +For more comprehensive guidance, refer to the official documentation on [Managing Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). diff --git a/Topics/Development_Process/Conda/Managing_packages.md b/Topics/Development_Process/Conda/Managing_packages.md new file mode 100644 index 000000000..821a823c2 --- /dev/null +++ b/Topics/Development_Process/Conda/Managing_packages.md @@ -0,0 +1,48 @@ + +## Managing Packages + +Details related to how to find, install, remove, and update packages in a given environment + +### Searching for Packages + +- Basic Search: `conda search packageName` to check if a package is available. +- Search in Specific Channel: `conda search --override-channels --channel channelURL packageName` for searching in a particular channel. + +### Installing Packages + +- Basic Installation: `conda install packageName` to install a package in the current environment. +- Specific Environment Installation: `conda install --name envName packageName` to install in a specified environment. +- Version-Specific Installation: `conda install packageName=versionNumber` for installing a specific version. +- Multiple Packages: `conda install packageName1 packageName2` to install multiple packages simultaneously. +- Packages from Anaconda.org: Use `conda install -c channelName` packageName for packages available on Anaconda.org but not in the default channels. +- Non-Conda Packages: If a package isn't available through conda, it can be installed via `conda-forge` or `pip`. + +### Updating Packages + +- Update Specific Package: `conda update packageName`. +- Update Python: `conda update python` updates to the latest in the current series (e.g., Python 3.7 to Python 3.8). +- Update Conda: `conda update conda`. +- Update Anaconda Metapackage: `conda update anaconda`. + +### Preventing Package Updates (Pinning) + +- Pinning Packages: Prevent specific packages from updating by adding them to a `pinned` file in the `conda-meta` directory of the environment. + +### Setting Default Packages for New Environments + +- Default Packages: `conda config --add create_default_packages packageName` to automatically install certain packages in every new environment. + +### Removing Packages + +- Remove Specific Package: `conda remove -n envName packageName` from a specific environment, or `conda remove packageName` from the current environment. +- Multiple Packages: `conda remove packageName1 packageName2` to remove multiple packages at once. + +### Listing Installed Packages + +- List Packages: `conda list` to view packages installed in the current environment, or `conda list -n envName` for a different environment. + +### Finding Package Dependencies + +- To find what packages depend on a specific package, use a combination of `conda search` and file searching in the Conda package cache. + +For more comprehensive guidance, refer to the official documentation on [Managing Packages](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html). diff --git a/Topics/Development_Process/Conda/Manging_Conda.md b/Topics/Development_Process/Conda/Manging_Conda.md new file mode 100644 index 000000000..80084d9b0 --- /dev/null +++ b/Topics/Development_Process/Conda/Manging_Conda.md @@ -0,0 +1,27 @@ +## Managing Conda + +Everything necessary to know about managing your installation of conda + +### Verifying Conda Installation + +- Command: `conda --version` +- This command should return the version of Conda installed. If it doesn't, ensure you are logged into the correct user account, are in a directory Conda can find, and have reopened the terminal after installation. + +### Determining Conda Version + +- Commands: `conda info` or `conda -V` +- Both commands provide details about the installed version of Conda. + +### Updating Conda + +- Command: `conda update conda` +- This command will check for the latest version of Conda and prompt you to update ('y' to proceed with the update). It also informs about other packages that will be updated or changed as a result of the Conda update. + +### Suppressing Warning Messages About Conda Updates + +- Command to Suppress Warnings: `conda config --set notify_outdated_conda false` +- This command stops Conda from displaying warnings about newer versions being available. +- Alternatively, you can manually add `notify_outdated_conda: false` to your `.condarc` file. + +For more comprehensive guidance, refer to the official documentation on [Managing Conda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-conda.html). + diff --git a/Topics/Development_Process/Conda/Tasks_Conda.md b/Topics/Development_Process/Conda/Tasks_Conda.md deleted file mode 100644 index a75a860e0..000000000 --- a/Topics/Development_Process/Conda/Tasks_Conda.md +++ /dev/null @@ -1,213 +0,0 @@ -## Managing Conda - -Managing Conda effectively is crucial for maintaining the integrity and functionality of your Conda environment. Regular updates ensure you have the latest features and security updates, while understanding how to check and manage its version can help troubleshoot any issues that may arise. These commands are an essential part of using Conda for managing Python environments, especially in environments where consistent and reproducible setups are important. - -### Verifying Conda Installation - -- Command: `conda --version` -- This command should return the version of Conda installed. If it doesn't, ensure you are logged into the correct user account, are in a directory Conda can find, and have reopened the terminal after installation. - -### Determining Conda Version - -- Commands: `conda info` or `conda -V` -- Both commands provide details about the installed version of Conda. - -### Updating Conda - -- Command: `conda update conda` -- This command will check for the latest version of Conda and prompt you to update ('y' to proceed with the update). It also informs about other packages that will be updated or changed as a result of the Conda update. - -### Suppressing Warning Messages About Conda Updates - -- Command to Suppress Warnings: `conda config --set notify_outdated_conda false` -- This command stops Conda from displaying warnings about newer versions being available. -- Alternatively, you can manually add `notify_outdated_conda: false` to your `.condarc` file. - -For more comprehensive guidance, refer to the official documentation on [Managing Conda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-conda.html). - -## Managing environments - -### Creating Environments: - -- Basic creation: `conda create --name ` -- With a specific Python version: `conda create -n myenv python=3.9` -- Including specific packages: `conda create -n myenv scipy` or `conda install -n myenv scipy` -- With specific package versions: `conda create -n myenv scipy=0.17.3` -- Combining Python version and multiple packages: `conda create -n myenv python=3.9 scipy=0.17.3 astroid babel` - -### Environment File: - -- Create an environment from environment.yml: `conda env create -f environment.yml` -- Activate the new environment: `conda activate myenv` -- Verify the environment: `conda env list` or `conda info --envs` - -### Specifying Environment Location: - -- Create an environment in a specific directory: `conda create --prefix ./envs jupyterlab=3.2` -- Activate with: `conda activate ./envs` -- Modify .condarc for a custom prompt - -### Updating an Environment: - -- Update based on changes in environment.yml: `conda env update --file environment.yml --prune` - -### Cloning an Environment: - -- Clone an existing environment: `conda create --name myclone --clone myenv` - -### Building Identical Environments: - -- Generate a spec file: `conda list --explicit > spec-file.txt` -- Create an environment from a spec file: `conda create --name myenv --file spec-file.txt` - -### Activating an Environment - -- Purpose: Adds environment entries to PATH and runs activation scripts, setting necessary environment variables. -- Command: `conda activate myenv` (replace myenv with your environment name). -- Windows Specifics: Due to its reliance on a dynamic-link library search order, proper activation on Windows is crucial to avoid errors like HTTP or SSL issues. - -### Conda Init - -- Background: Introduced in Conda 4.4, improved in Conda 4.6 to support a variety of shells (bash, zsh, csh, fish, xonsh). -- Key Feature: Allows the use of conda activate without modifying the PATH, reducing disruptions to other software. -- Auto-activation of Base Environment: Can be controlled via the auto_activate_base setting. - -### Nested Activation - -- Usage: `conda activate --stack myenv` to retain current environment in the PATH. -- Auto-Stacking: Configurable for automatic stacking when moving from outermost (base) environment. - -### Environment Variables for DLL Loading - -- Warning: Without activation, environment variable setting and script activations don't occur. Full support is only for activated environments. - -### Deactivating an Environment - -- Command: `conda deactivate` to remove the path of the current active environment. -- Note: From the base environment, use `conda activate` to return to the base instead of `conda deactivate`. - -### Determining Your Current Environment - -- Indication: Active environment shown in parentheses or brackets at the beginning of the command prompt. -- Checking Environment: `conda info --envs` shows a list with the current environment marked. -- Prompt Display Setting: Can be toggled with `conda config --set changeps1 false/true`. - -### Viewing a List of Your Environments - -- Command: `conda info --envs` or `conda env list` to see all environments. -- Administrator View: Shows all environments for all users if run by an administrator. - -### Viewing a List of Packages in an Environment - -- For a Non-Activated Environment: `conda list -n myenv` -- For an Activated Environment: `conda list` -- To Check for a Specific Package: `conda list -n myenv scipy` - -### Using Pip in an Environment - -- It's recommended to use Conda before Pip within environments for package installation. -- Using Pip after Conda helps avoid potential dependency conflicts. -- Creating isolated Conda environments for Pip usage is advised. -- If you need to make significant changes after using Pip, recreate the Conda environment. - -### Setting Environment Variables -- `conda env config vars set` and `unset` commands are used to manage environment variables. -- Set environment variables are specific to each Conda environment and are removed upon deactivation. - -### Saving Environment Variables - -- Scripts can be written to automatically set and unset environment variables upon activation and deactivation of an environment. -- Different scripts are used for Windows (`env_vars.bat`) and UNIX-like systems (macOS and Linux, `env_vars.sh`). - -### Sharing an Environment - -- Environments can be shared via an `environment.yml` file, which lists all packages and versions. -- The `conda env export > environment.yml` command is used to create this file. -- For cross-platform compatibility, `conda env export --from-history` includes only explicitly requested packages. - -### Restoring an Environment - -- `conda list --revisions` shows the history of changes made to the environment. -- Environments can be restored to previous states using `conda install --revision=REVNUM`. - -### Removing an Environment - -- Environments are removed with `conda remove --name myenv --all` or `conda env remove --name myenv`. -- The removal can be verified using `conda info --envs`. - -For more comprehensive guidance, refer to the official documentation on [Managing Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). - -## Managing Channels - -### Conda Channels - -- What They Are: Channels are the locations (URLs) where Conda packages are stored. -- Default Behavior: By default, Conda searches a set of default channels and downloads/updates packages from there. -- Channel Collisions: These occur when multiple channels host the same package. Conda has ways to resolve these collisions. - -### Channel Priority - -- Default Priority Resolution: Conda prioritizes packages based on the channel priority (higher priority channels are preferred), then by version number, and finally by build number within each channel. -- Strict Channel Priority: This mode, available from Conda 4.6.0 onwards, ensures that packages in lower priority channels are not considered if the same package is available in a higher priority channel. It speeds up operations and reduces package incompatibility issues. -- Flexible Channel Priority: This is the default setting where Conda can reach into lower priority channels to fulfill dependencies if necessary. -- Disabled Channel Priority: Here, the package version takes precedence, and channel priority only breaks ties. - -### Configuring Channel Priority - -- Setting Strict Priority: Use conda config --set channel_priority strict. -- Disabling Channel Priority: Add channel_priority: disabled in the .condarc file or use conda config --set channel_priority disabled. -- Adding Channels: Use conda config --add channels new_channel to add a channel to the top (highest priority) or conda config --append channels new_channel for the bottom (lowest priority). - -### Practical Implications - -- No Collisions with Defaults Only: Using only the defaults channel prevents collisions. -- Prioritizing Channels: The order of channels in your configuration affects how packages are resolved, especially when multiple channels offer the same package. -- Using Strict Priority: This is recommended for faster operations and fewer incompatibility problems, but it might limit the availability of certain packages if they're only found in lower-priority channels. - -For more comprehensive guidance, refer to the official documentation on [Managing Channels](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html). - -## Managing Packages - -### Searching for Packages - -- Basic Search: `conda search packageName` to check if a package is available. -- Search in Specific Channel: `conda search --override-channels --channel channelURL packageName` for searching in a particular channel. - -### Installing Packages - -- Basic Installation: `conda install packageName` to install a package in the current environment. -- Specific Environment Installation: `conda install --name envName packageName` to install in a specified environment. -- Version-Specific Installation: `conda install packageName=versionNumber` for installing a specific version. -- Multiple Packages: `conda install packageName1 packageName2` to install multiple packages simultaneously. -- Packages from Anaconda.org: Use `conda install -c channelName` packageName for packages available on Anaconda.org but not in the default channels. -- Non-Conda Packages: If a package isn't available through conda, it can be installed via `conda-forge` or `pip`. - -### Updating Packages - -- Update Specific Package: `conda update packageName`. -- Update Python: `conda update python` updates to the latest in the current series (e.g., Python 3.7 to Python 3.8). -- Update Conda: `conda update conda`. -- Update Anaconda Metapackage: `conda update anaconda`. - -### Preventing Package Updates (Pinning) - -- Pinning Packages: Prevent specific packages from updating by adding them to a `pinned` file in the `conda-meta` directory of the environment. - -### Setting Default Packages for New Environments - -- Default Packages: `conda config --add create_default_packages packageName` to automatically install certain packages in every new environment. - -### Removing Packages - -- Remove Specific Package: `conda remove -n envName packageName` from a specific environment, or `conda remove packageName` from the current environment. -- Multiple Packages: `conda remove packageName1 packageName2` to remove multiple packages at once. - -### Listing Installed Packages - -- List Packages: `conda list` to view packages installed in the current environment, or `conda list -n envName` for a different environment. - -### Finding Package Dependencies - -- To find what packages depend on a specific package, use a combination of `conda search` and file searching in the Conda package cache. - -For more comprehensive guidance, refer to the official documentation on [Managing Packages](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html). From 16f3eb09295616d2ca715e1cc8d8975afeae2ca5 Mon Sep 17 00:00:00 2001 From: Yanke Mao <78478237+YankeMao@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:38:12 -0400 Subject: [PATCH 3/8] Update Managing_channels.md Change the point titles into Boldface. Correct punctuation --- .../Conda/Managing_channels.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Topics/Development_Process/Conda/Managing_channels.md b/Topics/Development_Process/Conda/Managing_channels.md index c05c57508..07990f014 100644 --- a/Topics/Development_Process/Conda/Managing_channels.md +++ b/Topics/Development_Process/Conda/Managing_channels.md @@ -1,31 +1,31 @@ ## Managing Channels -Information about channels and how they are searched through when installing packages +Information about channels and how they are searched through when installing packages. ### Conda Channels -- What They Are: Channels are the locations (URLs) where Conda packages are stored. -- Default Behavior: By default, Conda searches a set of default channels and downloads/updates packages from there. -- Channel Collisions: These occur when multiple channels host the same package. Conda has ways to resolve these collisions. +- **What They Are**: Channels are the locations (URLs) where Conda packages are stored. +- **Default Behavior**: By default, Conda searches a set of default channels and downloads/updates packages from there. +- **Channel Collisions**: These occur when multiple channels host the same package. Conda has ways to resolve these collisions. ### Channel Priority -- Default Priority Resolution: Conda prioritizes packages based on the channel priority (higher priority channels are preferred), then by version number, and finally by build number within each channel. -- Strict Channel Priority: This mode, available from Conda 4.6.0 onwards, ensures that packages in lower priority channels are not considered if the same package is available in a higher priority channel. It speeds up operations and reduces package incompatibility issues. -- Flexible Channel Priority: This is the default setting where Conda can reach into lower priority channels to fulfill dependencies if necessary. -- Disabled Channel Priority: Here, the package version takes precedence, and channel priority only breaks ties. +- **Default Priority Resolution**: Conda prioritizes packages based on the channel priority (higher priority channels are preferred), then by version number, and finally by build number within each channel. +- **Strict Channel Priority**: This mode, available from Conda 4.6.0 onwards, ensures that packages in lower priority channels are not considered if the same package is available in a higher priority channel. It speeds up operations and reduces package incompatibility issues. +- **Flexible Channel Priority**: This is the default setting where Conda can reach into lower priority channels to fulfill dependencies if necessary. +- **Disabled Channel Priority**: Here, the package version takes precedence, and channel priority only breaks ties. ### Configuring Channel Priority -- Setting Strict Priority: Use conda config --set channel_priority strict. -- Disabling Channel Priority: Add channel_priority: disabled in the .condarc file or use conda config --set channel_priority disabled. -- Adding Channels: Use conda config --add channels new_channel to add a channel to the top (highest priority) or conda config --append channels new_channel for the bottom (lowest priority). +- **Setting Strict Priority**: Use conda config --set channel_priority strict. +- **Disabling Channel Priority**: Add channel_priority: disabled in the .condarc file or use conda config --set channel_priority disabled. +- **Adding Channels**: Use conda config --add channels new_channel to add a channel to the top (highest priority) or conda config --append channels new_channel to the bottom (lowest priority). ### Practical Implications -- No Collisions with Defaults Only: Using only the defaults channel prevents collisions. -- Prioritizing Channels: The order of channels in your configuration affects how packages are resolved, especially when multiple channels offer the same package. -- Using Strict Priority: This is recommended for faster operations and fewer incompatibility problems, but it might limit the availability of certain packages if they're only found in lower-priority channels. +- **No Collisions with Defaults Only**: Using only the default channel prevents collisions. +- **Prioritizing Channels**: The order of channels in your configuration affects how packages are resolved, especially when multiple channels offer the same package. +- **Using Strict Priority**: This is recommended for faster operations and fewer incompatibility problems, but it might limit the availability of certain packages if they're only found in lower-priority channels. For more comprehensive guidance, refer to the official documentation on [Managing Channels](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html). From c54aae9175ece906a71724215734e93159110e36 Mon Sep 17 00:00:00 2001 From: Yanke Mao <78478237+YankeMao@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:43:40 -0400 Subject: [PATCH 4/8] Update Managing_environments.md Change the point titles into Boldface. Correct punctuation --- .../Conda/Managing_environments.md | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/Topics/Development_Process/Conda/Managing_environments.md b/Topics/Development_Process/Conda/Managing_environments.md index 2becea6ba..48896b13f 100644 --- a/Topics/Development_Process/Conda/Managing_environments.md +++ b/Topics/Development_Process/Conda/Managing_environments.md @@ -1,82 +1,82 @@ ## Managing environments -Various operations involved with creating, updating, exporting, and removing environments, plus more +Various operations involved with creating, updating, exporting, and removing environments, plus more. ### Creating Environments: -- Basic creation: `conda create --name ` -- With a specific Python version: `conda create -n myenv python=3.9` -- Including specific packages: `conda create -n myenv scipy` or `conda install -n myenv scipy` -- With specific package versions: `conda create -n myenv scipy=0.17.3` -- Combining Python version and multiple packages: `conda create -n myenv python=3.9 scipy=0.17.3 astroid babel` +- **Basic creation**: `conda create --name ` +- **With a specific Python version**: `conda create -n myenv python=3.9` +- **Including specific packages**: `conda create -n myenv scipy` or `conda install -n myenv scipy` +- **With specific package versions**: `conda create -n myenv scipy=0.17.3` +- **Combining Python version and multiple packages**: `conda create -n myenv python=3.9 scipy=0.17.3 astroid babel` ### Environment File: -- Create an environment from environment.yml: `conda env create -f environment.yml` -- Activate the new environment: `conda activate myenv` -- Verify the environment: `conda env list` or `conda info --envs` +- **Create an environment from environment.yml**: `conda env create -f environment.yml` +- **Activate the new environment**: `conda activate myenv` +- **Verify the environment**: `conda env list` or `conda info --envs` ### Specifying Environment Location: -- Create an environment in a specific directory: `conda create --prefix ./envs jupyterlab=3.2` -- Activate with: `conda activate ./envs` +- **Create an environment in a specific directory**: `conda create --prefix ./envs jupyterlab=3.2` +- **Activate environment**: `conda activate ./envs` - Modify .condarc for a custom prompt ### Updating an Environment: -- Update based on changes in environment.yml: `conda env update --file environment.yml --prune` +- **Update based on changes in environment.yml**: `conda env update --file environment.yml --prune` ### Cloning an Environment: -- Clone an existing environment: `conda create --name myclone --clone myenv` +- **Clone an existing environment**: `conda create --name myclone --clone myenv` ### Building Identical Environments: -- Generate a spec file: `conda list --explicit > spec-file.txt` -- Create an environment from a spec file: `conda create --name myenv --file spec-file.txt` +- **Generate a spec file**: `conda list --explicit > spec-file.txt` +- **Create an environment from a spec file**: `conda create --name myenv --file spec-file.txt` ### Activating an Environment -- Purpose: Adds environment entries to PATH and runs activation scripts, setting necessary environment variables. -- Command: `conda activate myenv` (replace myenv with your environment name). -- Windows Specifics: Due to its reliance on a dynamic-link library search order, proper activation on Windows is crucial to avoid errors like HTTP or SSL issues. +- **Purpose**: Adds environment entries to PATH and runs activation scripts, setting necessary environment variables. +- **Command**: `conda activate myenv` (replace myenv with your environment name). +- **Windows Specifics**: Due to its reliance on a dynamic-link library search order, proper activation on Windows is crucial to avoid errors like HTTP or SSL issues. ### Conda Init -- Background: Introduced in Conda 4.4, improved in Conda 4.6 to support a variety of shells (bash, zsh, csh, fish, xonsh). -- Key Feature: Allows the use of conda activate without modifying the PATH, reducing disruptions to other software. -- Auto-activation of Base Environment: Can be controlled via the auto_activate_base setting. +- **Background**: Introduced in Conda 4.4, improved in Conda 4.6 to support a variety of shells (bash, zsh, csh, fish, xonsh). +- **Key Feature**: Allows the use of conda activate without modifying the PATH, reducing disruptions to other software. +- **Auto-activation of Base Environment**: Can be controlled via the auto_activate_base setting. ### Nested Activation -- Usage: `conda activate --stack myenv` to retain current environment in the PATH. -- Auto-Stacking: Configurable for automatic stacking when moving from outermost (base) environment. +- **Usage**: `conda activate --stack myenv` to retain the current environment in the PATH. +- **Auto-Stacking**: Configurable for automatic stacking when moving from the outermost (base) environment. ### Environment Variables for DLL Loading -- Warning: Without activation, environment variable setting and script activations don't occur. Full support is only for activated environments. +- **Warning**: Without activation, environment variable setting and script activations don't occur. Full support is only for activated environments. ### Deactivating an Environment -- Command: `conda deactivate` to remove the path of the current active environment. -- Note: From the base environment, use `conda activate` to return to the base instead of `conda deactivate`. +- **Command**: `conda deactivate` to remove the path of the current active environment. +- **Note**: From the base environment, use `conda activate` to return to the base instead of `conda deactivate`. ### Determining Your Current Environment -- Indication: Active environment shown in parentheses or brackets at the beginning of the command prompt. -- Checking Environment: `conda info --envs` shows a list with the current environment marked. -- Prompt Display Setting: Can be toggled with `conda config --set changeps1 false/true`. +- **Indication**: Active environment shown in parentheses or brackets at the beginning of the command prompt. +- **Checking Environment**: `conda info --envs` shows a list with the current environment marked. +- **Prompt Display Setting**: Can be toggled with `conda config --set changeps1 false/true`. ### Viewing a List of Your Environments -- Command: `conda info --envs` or `conda env list` to see all environments. -- Administrator View: Shows all environments for all users if run by an administrator. +- **Command**: `conda info --envs` or `conda env list` to see all environments. +- **Administrator View**: Shows all environments for all users if run by an administrator. ### Viewing a List of Packages in an Environment -- For a Non-Activated Environment: `conda list -n myenv` -- For an Activated Environment: `conda list` -- To Check for a Specific Package: `conda list -n myenv scipy` +- **For a Non-Activated Environment**: `conda list -n myenv` +- **For an Activated Environment**: `conda list` +- **To Check for a Specific Package**: `conda list -n myenv scipy` ### Using Pip in an Environment From 54ff762db1c52957384538f0511b488d32990e77 Mon Sep 17 00:00:00 2001 From: Yanke Mao <78478237+YankeMao@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:48:09 -0400 Subject: [PATCH 5/8] Update Managing_packages.md Change the point titles into Boldface. Correct punctuation --- .../Conda/Managing_packages.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Topics/Development_Process/Conda/Managing_packages.md b/Topics/Development_Process/Conda/Managing_packages.md index 821a823c2..0aacb2120 100644 --- a/Topics/Development_Process/Conda/Managing_packages.md +++ b/Topics/Development_Process/Conda/Managing_packages.md @@ -1,45 +1,45 @@ ## Managing Packages -Details related to how to find, install, remove, and update packages in a given environment +Details related to how to find, install, remove, and update packages in a given environment. ### Searching for Packages -- Basic Search: `conda search packageName` to check if a package is available. -- Search in Specific Channel: `conda search --override-channels --channel channelURL packageName` for searching in a particular channel. +- **Basic Search**: `conda search packageName` to check if a package is available. +- **Search in Specific Channel**: `conda search --override-channels --channel channelURL packageName` for searching in a particular channel. ### Installing Packages -- Basic Installation: `conda install packageName` to install a package in the current environment. -- Specific Environment Installation: `conda install --name envName packageName` to install in a specified environment. -- Version-Specific Installation: `conda install packageName=versionNumber` for installing a specific version. -- Multiple Packages: `conda install packageName1 packageName2` to install multiple packages simultaneously. -- Packages from Anaconda.org: Use `conda install -c channelName` packageName for packages available on Anaconda.org but not in the default channels. -- Non-Conda Packages: If a package isn't available through conda, it can be installed via `conda-forge` or `pip`. +- **Basic Installation**: `conda install packageName` to install a package in the current environment. +- **Specific Environment Installation**: `conda install --name envName packageName` to install in a specified environment. +- **Version-Specific Installation**: `conda install packageName=versionNumber` for installing a specific version. +- **Multiple Packages**: `conda install packageName1 packageName2` to install multiple packages simultaneously. +- **Packages from Anaconda.org**: Use `conda install -c channelName` packageName for packages available on Anaconda.org but not in the default channels. +- **Non-Conda Packages**: If a package isn't available through conda, it can be installed via `conda-forge` or `pip`. ### Updating Packages -- Update Specific Package: `conda update packageName`. -- Update Python: `conda update python` updates to the latest in the current series (e.g., Python 3.7 to Python 3.8). -- Update Conda: `conda update conda`. -- Update Anaconda Metapackage: `conda update anaconda`. +- **Update Specific Package**: `conda update packageName`. +- **Update Python**: `conda update python` updates to the latest in the current series (e.g., Python 3.7 to Python 3.8). +- **Update Conda**: `conda update conda`. +- **Update Anaconda Metapackage**: `conda update anaconda`. ### Preventing Package Updates (Pinning) -- Pinning Packages: Prevent specific packages from updating by adding them to a `pinned` file in the `conda-meta` directory of the environment. +- **Pinning Packages**: Prevent specific packages from updating by adding them to a `pinned` file in the `conda-meta` directory of the environment. ### Setting Default Packages for New Environments -- Default Packages: `conda config --add create_default_packages packageName` to automatically install certain packages in every new environment. +- **Default Packages**: `conda config --add create_default_packages packageName` to automatically install certain packages in every new environment. ### Removing Packages -- Remove Specific Package: `conda remove -n envName packageName` from a specific environment, or `conda remove packageName` from the current environment. -- Multiple Packages: `conda remove packageName1 packageName2` to remove multiple packages at once. +- **Remove Specific Package**: `conda remove -n envName packageName` from a specific environment, or `conda remove packageName` from the current environment. +- **Multiple Packages**: `conda remove packageName1 packageName2` to remove multiple packages at once. ### Listing Installed Packages -- List Packages: `conda list` to view packages installed in the current environment, or `conda list -n envName` for a different environment. +- **List Packages**: `conda list` to view packages installed in the current environment, or `conda list -n envName` for a different environment. ### Finding Package Dependencies From 662726dd111acb9538c30df36aec9ae6c971a15a Mon Sep 17 00:00:00 2001 From: Yanke Mao <78478237+YankeMao@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:49:57 -0400 Subject: [PATCH 6/8] Update Manging_Conda.md Change the point titles into Boldface. Correct punctuation --- Topics/Development_Process/Conda/Manging_Conda.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Topics/Development_Process/Conda/Manging_Conda.md b/Topics/Development_Process/Conda/Manging_Conda.md index 80084d9b0..f33181ebf 100644 --- a/Topics/Development_Process/Conda/Manging_Conda.md +++ b/Topics/Development_Process/Conda/Manging_Conda.md @@ -4,22 +4,22 @@ Everything necessary to know about managing your installation of conda ### Verifying Conda Installation -- Command: `conda --version` +- **Command**: `conda --version` - This command should return the version of Conda installed. If it doesn't, ensure you are logged into the correct user account, are in a directory Conda can find, and have reopened the terminal after installation. ### Determining Conda Version -- Commands: `conda info` or `conda -V` +- **Commands**: `conda info` or `conda -V` - Both commands provide details about the installed version of Conda. ### Updating Conda -- Command: `conda update conda` +- **Command**: `conda update conda` - This command will check for the latest version of Conda and prompt you to update ('y' to proceed with the update). It also informs about other packages that will be updated or changed as a result of the Conda update. ### Suppressing Warning Messages About Conda Updates -- Command to Suppress Warnings: `conda config --set notify_outdated_conda false` +- **Command to Suppress Warnings**: `conda config --set notify_outdated_conda false` - This command stops Conda from displaying warnings about newer versions being available. - Alternatively, you can manually add `notify_outdated_conda: false` to your `.condarc` file. From 614afd7ddf6afc34a96e8289733140e8666a4258 Mon Sep 17 00:00:00 2001 From: Yanke Mao Date: Tue, 19 Mar 2024 23:01:03 -0400 Subject: [PATCH 7/8] Change the format of titles and subtitles to make them consist with other files --- .../Conda/Managing_channels.md | 10 ++--- .../Conda/Managing_environments.md | 42 +++++++++---------- .../Conda/Managing_packages.md | 18 ++++---- .../Conda/Manging_Conda.md | 10 ++--- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Topics/Development_Process/Conda/Managing_channels.md b/Topics/Development_Process/Conda/Managing_channels.md index 07990f014..ad93658e4 100644 --- a/Topics/Development_Process/Conda/Managing_channels.md +++ b/Topics/Development_Process/Conda/Managing_channels.md @@ -1,28 +1,28 @@ -## Managing Channels +# Managing Channels Information about channels and how they are searched through when installing packages. -### Conda Channels +## Conda Channels - **What They Are**: Channels are the locations (URLs) where Conda packages are stored. - **Default Behavior**: By default, Conda searches a set of default channels and downloads/updates packages from there. - **Channel Collisions**: These occur when multiple channels host the same package. Conda has ways to resolve these collisions. -### Channel Priority +## Channel Priority - **Default Priority Resolution**: Conda prioritizes packages based on the channel priority (higher priority channels are preferred), then by version number, and finally by build number within each channel. - **Strict Channel Priority**: This mode, available from Conda 4.6.0 onwards, ensures that packages in lower priority channels are not considered if the same package is available in a higher priority channel. It speeds up operations and reduces package incompatibility issues. - **Flexible Channel Priority**: This is the default setting where Conda can reach into lower priority channels to fulfill dependencies if necessary. - **Disabled Channel Priority**: Here, the package version takes precedence, and channel priority only breaks ties. -### Configuring Channel Priority +## Configuring Channel Priority - **Setting Strict Priority**: Use conda config --set channel_priority strict. - **Disabling Channel Priority**: Add channel_priority: disabled in the .condarc file or use conda config --set channel_priority disabled. - **Adding Channels**: Use conda config --add channels new_channel to add a channel to the top (highest priority) or conda config --append channels new_channel to the bottom (lowest priority). -### Practical Implications +## Practical Implications - **No Collisions with Defaults Only**: Using only the default channel prevents collisions. - **Prioritizing Channels**: The order of channels in your configuration affects how packages are resolved, especially when multiple channels offer the same package. diff --git a/Topics/Development_Process/Conda/Managing_environments.md b/Topics/Development_Process/Conda/Managing_environments.md index 48896b13f..1eb2d4a15 100644 --- a/Topics/Development_Process/Conda/Managing_environments.md +++ b/Topics/Development_Process/Conda/Managing_environments.md @@ -1,8 +1,8 @@ -## Managing environments +# Managing environments Various operations involved with creating, updating, exporting, and removing environments, plus more. -### Creating Environments: +## Creating Environments: - **Basic creation**: `conda create --name ` - **With a specific Python version**: `conda create -n myenv python=3.9` @@ -10,102 +10,102 @@ Various operations involved with creating, updating, exporting, and removing env - **With specific package versions**: `conda create -n myenv scipy=0.17.3` - **Combining Python version and multiple packages**: `conda create -n myenv python=3.9 scipy=0.17.3 astroid babel` -### Environment File: +## Environment File: - **Create an environment from environment.yml**: `conda env create -f environment.yml` - **Activate the new environment**: `conda activate myenv` - **Verify the environment**: `conda env list` or `conda info --envs` -### Specifying Environment Location: +## Specifying Environment Location: - **Create an environment in a specific directory**: `conda create --prefix ./envs jupyterlab=3.2` - **Activate environment**: `conda activate ./envs` - Modify .condarc for a custom prompt -### Updating an Environment: +## Updating an Environment: - **Update based on changes in environment.yml**: `conda env update --file environment.yml --prune` -### Cloning an Environment: +## Cloning an Environment: - **Clone an existing environment**: `conda create --name myclone --clone myenv` -### Building Identical Environments: +## Building Identical Environments: - **Generate a spec file**: `conda list --explicit > spec-file.txt` - **Create an environment from a spec file**: `conda create --name myenv --file spec-file.txt` -### Activating an Environment +## Activating an Environment - **Purpose**: Adds environment entries to PATH and runs activation scripts, setting necessary environment variables. - **Command**: `conda activate myenv` (replace myenv with your environment name). - **Windows Specifics**: Due to its reliance on a dynamic-link library search order, proper activation on Windows is crucial to avoid errors like HTTP or SSL issues. -### Conda Init +## Conda Init - **Background**: Introduced in Conda 4.4, improved in Conda 4.6 to support a variety of shells (bash, zsh, csh, fish, xonsh). - **Key Feature**: Allows the use of conda activate without modifying the PATH, reducing disruptions to other software. - **Auto-activation of Base Environment**: Can be controlled via the auto_activate_base setting. -### Nested Activation +## Nested Activation - **Usage**: `conda activate --stack myenv` to retain the current environment in the PATH. - **Auto-Stacking**: Configurable for automatic stacking when moving from the outermost (base) environment. -### Environment Variables for DLL Loading +## Environment Variables for DLL Loading - **Warning**: Without activation, environment variable setting and script activations don't occur. Full support is only for activated environments. -### Deactivating an Environment +## Deactivating an Environment - **Command**: `conda deactivate` to remove the path of the current active environment. - **Note**: From the base environment, use `conda activate` to return to the base instead of `conda deactivate`. -### Determining Your Current Environment +## Determining Your Current Environment - **Indication**: Active environment shown in parentheses or brackets at the beginning of the command prompt. - **Checking Environment**: `conda info --envs` shows a list with the current environment marked. - **Prompt Display Setting**: Can be toggled with `conda config --set changeps1 false/true`. -### Viewing a List of Your Environments +## Viewing a List of Your Environments - **Command**: `conda info --envs` or `conda env list` to see all environments. - **Administrator View**: Shows all environments for all users if run by an administrator. -### Viewing a List of Packages in an Environment +## Viewing a List of Packages in an Environment - **For a Non-Activated Environment**: `conda list -n myenv` - **For an Activated Environment**: `conda list` - **To Check for a Specific Package**: `conda list -n myenv scipy` -### Using Pip in an Environment +## Using Pip in an Environment - It's recommended to use Conda before Pip within environments for package installation. - Using Pip after Conda helps avoid potential dependency conflicts. - Creating isolated Conda environments for Pip usage is advised. - If you need to make significant changes after using Pip, recreate the Conda environment. -### Setting Environment Variables +## Setting Environment Variables - `conda env config vars set` and `unset` commands are used to manage environment variables. - Set environment variables are specific to each Conda environment and are removed upon deactivation. -### Saving Environment Variables +## Saving Environment Variables - Scripts can be written to automatically set and unset environment variables upon activation and deactivation of an environment. - Different scripts are used for Windows (`env_vars.bat`) and UNIX-like systems (macOS and Linux, `env_vars.sh`). -### Sharing an Environment +## Sharing an Environment - Environments can be shared via an `environment.yml` file, which lists all packages and versions. - The `conda env export > environment.yml` command is used to create this file. - For cross-platform compatibility, `conda env export --from-history` includes only explicitly requested packages. -### Restoring an Environment +## Restoring an Environment - `conda list --revisions` shows the history of changes made to the environment. - Environments can be restored to previous states using `conda install --revision=REVNUM`. -### Removing an Environment +## Removing an Environment - Environments are removed with `conda remove --name myenv --all` or `conda env remove --name myenv`. - The removal can be verified using `conda info --envs`. diff --git a/Topics/Development_Process/Conda/Managing_packages.md b/Topics/Development_Process/Conda/Managing_packages.md index 0aacb2120..989e53eb6 100644 --- a/Topics/Development_Process/Conda/Managing_packages.md +++ b/Topics/Development_Process/Conda/Managing_packages.md @@ -1,14 +1,14 @@ -## Managing Packages +# Managing Packages Details related to how to find, install, remove, and update packages in a given environment. -### Searching for Packages +## Searching for Packages - **Basic Search**: `conda search packageName` to check if a package is available. - **Search in Specific Channel**: `conda search --override-channels --channel channelURL packageName` for searching in a particular channel. -### Installing Packages +## Installing Packages - **Basic Installation**: `conda install packageName` to install a package in the current environment. - **Specific Environment Installation**: `conda install --name envName packageName` to install in a specified environment. @@ -17,31 +17,31 @@ Details related to how to find, install, remove, and update packages in a given - **Packages from Anaconda.org**: Use `conda install -c channelName` packageName for packages available on Anaconda.org but not in the default channels. - **Non-Conda Packages**: If a package isn't available through conda, it can be installed via `conda-forge` or `pip`. -### Updating Packages +## Updating Packages - **Update Specific Package**: `conda update packageName`. - **Update Python**: `conda update python` updates to the latest in the current series (e.g., Python 3.7 to Python 3.8). - **Update Conda**: `conda update conda`. - **Update Anaconda Metapackage**: `conda update anaconda`. -### Preventing Package Updates (Pinning) +## Preventing Package Updates (Pinning) - **Pinning Packages**: Prevent specific packages from updating by adding them to a `pinned` file in the `conda-meta` directory of the environment. -### Setting Default Packages for New Environments +## Setting Default Packages for New Environments - **Default Packages**: `conda config --add create_default_packages packageName` to automatically install certain packages in every new environment. -### Removing Packages +## Removing Packages - **Remove Specific Package**: `conda remove -n envName packageName` from a specific environment, or `conda remove packageName` from the current environment. - **Multiple Packages**: `conda remove packageName1 packageName2` to remove multiple packages at once. -### Listing Installed Packages +## Listing Installed Packages - **List Packages**: `conda list` to view packages installed in the current environment, or `conda list -n envName` for a different environment. -### Finding Package Dependencies +## Finding Package Dependencies - To find what packages depend on a specific package, use a combination of `conda search` and file searching in the Conda package cache. diff --git a/Topics/Development_Process/Conda/Manging_Conda.md b/Topics/Development_Process/Conda/Manging_Conda.md index f33181ebf..1038508fc 100644 --- a/Topics/Development_Process/Conda/Manging_Conda.md +++ b/Topics/Development_Process/Conda/Manging_Conda.md @@ -1,23 +1,23 @@ -## Managing Conda +# Managing Conda Everything necessary to know about managing your installation of conda -### Verifying Conda Installation +## Verifying Conda Installation - **Command**: `conda --version` - This command should return the version of Conda installed. If it doesn't, ensure you are logged into the correct user account, are in a directory Conda can find, and have reopened the terminal after installation. -### Determining Conda Version +## Determining Conda Version - **Commands**: `conda info` or `conda -V` - Both commands provide details about the installed version of Conda. -### Updating Conda +## Updating Conda - **Command**: `conda update conda` - This command will check for the latest version of Conda and prompt you to update ('y' to proceed with the update). It also informs about other packages that will be updated or changed as a result of the Conda update. -### Suppressing Warning Messages About Conda Updates +## Suppressing Warning Messages About Conda Updates - **Command to Suppress Warnings**: `conda config --set notify_outdated_conda false` - This command stops Conda from displaying warnings about newer versions being available. From 561bdfd9a32ed46fd71469576fd853a61f5f5c5c Mon Sep 17 00:00:00 2001 From: Yanke Mao Date: Tue, 19 Mar 2024 23:11:16 -0400 Subject: [PATCH 8/8] Add reference for each file --- Topics/Development_Process/Conda/Managing_channels.md | 4 ++++ Topics/Development_Process/Conda/Managing_environments.md | 4 ++++ Topics/Development_Process/Conda/Managing_packages.md | 4 ++++ Topics/Development_Process/Conda/Manging_Conda.md | 3 +++ 4 files changed, 15 insertions(+) diff --git a/Topics/Development_Process/Conda/Managing_channels.md b/Topics/Development_Process/Conda/Managing_channels.md index ad93658e4..92f0591e3 100644 --- a/Topics/Development_Process/Conda/Managing_channels.md +++ b/Topics/Development_Process/Conda/Managing_channels.md @@ -29,3 +29,7 @@ Information about channels and how they are searched through when installing pac - **Using Strict Priority**: This is recommended for faster operations and fewer incompatibility problems, but it might limit the availability of certain packages if they're only found in lower-priority channels. For more comprehensive guidance, refer to the official documentation on [Managing Channels](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html). + +## Reference + +1. Conda Official Documentation. Available at: [Conda Documentation](https://docs.conda.io/projects/conda/en/latest/index.html) diff --git a/Topics/Development_Process/Conda/Managing_environments.md b/Topics/Development_Process/Conda/Managing_environments.md index 1eb2d4a15..9b0fd543a 100644 --- a/Topics/Development_Process/Conda/Managing_environments.md +++ b/Topics/Development_Process/Conda/Managing_environments.md @@ -111,3 +111,7 @@ Various operations involved with creating, updating, exporting, and removing env - The removal can be verified using `conda info --envs`. For more comprehensive guidance, refer to the official documentation on [Managing Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). + +## Reference + +1. Conda Official Documentation. Available at: [Conda Documentation](https://docs.conda.io/projects/conda/en/latest/index.html) diff --git a/Topics/Development_Process/Conda/Managing_packages.md b/Topics/Development_Process/Conda/Managing_packages.md index 989e53eb6..5e03800e6 100644 --- a/Topics/Development_Process/Conda/Managing_packages.md +++ b/Topics/Development_Process/Conda/Managing_packages.md @@ -46,3 +46,7 @@ Details related to how to find, install, remove, and update packages in a given - To find what packages depend on a specific package, use a combination of `conda search` and file searching in the Conda package cache. For more comprehensive guidance, refer to the official documentation on [Managing Packages](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html). + +## Reference + +1. Conda Official Documentation. Available at: [Conda Documentation](https://docs.conda.io/projects/conda/en/latest/index.html) diff --git a/Topics/Development_Process/Conda/Manging_Conda.md b/Topics/Development_Process/Conda/Manging_Conda.md index 1038508fc..2ca9349fd 100644 --- a/Topics/Development_Process/Conda/Manging_Conda.md +++ b/Topics/Development_Process/Conda/Manging_Conda.md @@ -25,3 +25,6 @@ Everything necessary to know about managing your installation of conda For more comprehensive guidance, refer to the official documentation on [Managing Conda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-conda.html). +## Reference + +1. Conda Official Documentation. Available at: [Conda Documentation](https://docs.conda.io/projects/conda/en/latest/index.html)