Conda/Mamba tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
(Template migration to LLM-Optimized Wiki Template)
Line 1: Line 1:
== Searching available package ==
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}
 
{{TOC}}
 
== Overview ==
 
Conda/Mamba tips and tricks에 대한 기술 문서입니다.
 
=== Summary ===
 
* 무엇인가? - Conda/Mamba tips and tricks
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
 
---
 
== Purpose ==
 
이 문서가 존재하는 이유
 
* Goal: Conda/Mamba tips and tricks에 대한 기술 정보 제공
* Scope: Conda/Mamba tips and tricks의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
 
---
 
== Key Concepts ==
 
{| class="wikitable"
! Concept
! Description
! Related
|-
| Conda/Mamba tips and tricks
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}
 
---
 
== Detailed Explanation ==
 
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# Search available package inside conda env
# Search available package inside conda env
$conda search <package_name>    # this command shows all avalable version of package
$conda search <package_name>    # this command shows all avalable version of package
</syntaxhighlight>
</syntaxhighlight>
== Install Mamba on Conda ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# prioritize 'conda-forge' channel
# prioritize 'conda-forge' channel
conda config --add channels conda-forge
conda config --add channels conda-forge
# update existing packages to use 'conda-forge' channel
# update existing packages to use 'conda-forge' channel
conda update -n base --all
conda update -n base --all
# install 'mamba'
# install 'mamba'
conda install -n base mamba
conda install -n base mamba
</syntaxhighlight>
</syntaxhighlight>
== The environment is inconsistent, please check the package plan carefully. The following packages are causing the inconsistency ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$conda install anaconda  # this command may take over an hour
$conda install anaconda  # this command may take over an hour
# after then
# after then
$conda update --all       
$conda update --all       
</syntaxhighlight>
</syntaxhighlight>
== Unable to activate environment - even after ‘conda init’ and re-login to the shell ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$ source activate base
$ source activate base
$ conda deactivate
$ conda deactivate


---


</syntaxhighlight>
== Best Practices ==
 
== Update Python version for the conda env using mamba and yaml file ==
<syntaxhighlight lang="bash">
# environment.yml to update package inside of your environment
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python >=3.10,<3.11
  - jupyterlab
  - numpy
  - scikit-learn
  - matplotlib-base # avoid qt if you can, if having trouble
 
$mamba env update -n <your env> --file environment.yml
</syntaxhighlight>
 
== Basic conda/mamba env setup in [[Manual:DLSSystem|DLS framework]] <ref>https://docs.conda.io/projects/conda/en/stable/commands/config.html</ref> ==
<syntaxhighlight lang="bash">
conda config --set auto_activate_base false
conda config --add channels r
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
</syntaxhighlight>
 
== How to fix InsecureRequestWarning: Unverified HTTPS request is being made to host ==
conda config --set ssl_verify false
 
== conda: error: argument COMMAND: invalid choice: 'actiate' ==
<syntaxhighlight lang="bash">
# Try activate base
$ source activate base
# Then deactivate it
(base) $ conda deactivate
 
# after then you can use activate command
$ conda activate base
</syntaxhighlight>


== Downgrading Conda Version ==
* 최신 버전 사용 권장
<syntaxhighlight lang="bash">
* 공식 문서 참고
conda config --set allow_conda_downgrades true
* 테스트 환경에서 먼저 검증
conda install conda=a.b.c  # version you want to install
</syntaxhighlight>


== Speedup Conda ==
---
[https://www.anaconda.com/blog/understanding-and-improving-condas-performance This] page describes how to speed up conda operation


some examples are,
== References ==


conda config --add channels bioconda
* [https://wiki.hpcmate.com Conda/Mamba tips and tricks]


conda config --set channel_priority strict
---


conda config --set safety_checks disabled
== Related Pages ==


== Conda commands ==
* [[Linux]]
{| class="wikitable sortable"
* [[Server]]
|+
* [[Hardware]]
!Commands
* [[Network]]
!Description
!Options
!Notes
|-
|conda update conda
|update the conda package manager to the latest version
|
|
|-
|conda update anaconda
|use conda to update Anaconda to the latest version
|
|
|-
|conda install anaconda=VERSION-NUMBER
|use conda to install a specific version of Anaconda
|
|
|-
|<code>conda config --add channels conda-forge</code>
|Add conda channel
|
|Update channels section of ~/.condarc file
|-
|<code>conda config --set channel_priority strict</code>
|Set channel priority policy
|
|
|-
|<code>conda config --show-sources</code>
|Show config status
|
|
|-
|<code>conda update --all --verbose</code>
|Update all conda with printout
|
|
|-
|<code>conda list --show-channel-urls</code>
|Listup conda channels
|
|
|-
|<code>conda search -f python</code>
|search available python version
|<code>Search can be extened with channels</code><code>$ cat ~/.condarc</code><code>channels:</code><code>- conda-forge</code><code>- bioconda</code><code>- defaults</code>
|Conda only has [[support]] for Python 3.8+ on the '''osx-arm64'''<ref>https://stackoverflow.com/questions/73052910/no-python-3-6-available-in-conda-search-f-python</ref>
To ''search'' alternative platforms, can use the <code>--subdir, --platform</code> argument to specify,


<code>$conda search --subdir osx-64 python=3.6</code>
---
or set the <code>subdir</code> configuration temporarily through the <code>CONDA_SUBDIR</code> environment variable:
<code>CONDA_SUBDIR=osx-64 conda search python=3.6</code>
|}


== Reference ==
[[Category:Server]]
<references />
[[Category:Reference]]
[[Category: Terminology]]
[[Category: Tips_Tricks]]

Revision as of 15:21, 16 July 2026

Template:Status

Template:TOC

Overview

Conda/Mamba tips and tricks에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Conda/Mamba tips and tricks
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시

---

Purpose

이 문서가 존재하는 이유

  • Goal: Conda/Mamba tips and tricks에 대한 기술 정보 제공
  • Scope: Conda/Mamba tips and tricks의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장

---

Key Concepts

Concept Description Related
Conda/Mamba tips and tricks HPC/서버 환경에서 중요한 기술 개념 Linux, Server

---

Detailed Explanation

# Search available package inside conda env
$conda search <package_name>    # this command shows all avalable version of package
# prioritize 'conda-forge' channel
conda config --add channels conda-forge
# update existing packages to use 'conda-forge' channel
conda update -n base --all
# install 'mamba'
conda install -n base mamba
$conda install anaconda   # this command may take over an hour
# after then
$conda update --all

<syntaxhighlight lang="bash"> $ source activate base $ conda deactivate

---

Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증

---

References

---

Related Pages

---