Mamba 加速python虚拟环境安装

简介: Mamba 加速python虚拟环境安装

Mamba 加速python虚拟环境安装


官网: github.com/mamba-org/m…

image.png

mamba是 C++ 中 Conda 包管理器的重新实现。


  • 使用多线程并行下载存储库数据和包文件
  • libsolv 用于更快的依赖关系求解,这是 Red Hat、Fedora 和 OpenSUSE 的 RPM 包管理器中使用的最先进的库
  • 的核心部分以C++实施,以实现最大效率mamba


同时,使用相同的命令行解析器、包安装和卸载代码以及事务验证例程,以尽可能保持兼容。mamba``conda

Mamba 是更大生态系统的一部分,旨在使科学包装更具可持续性。您可以阅读我们的公告博客文章。 该生态系统还包括一个开源软件包服务器和一个快速的软件包构建器。


1.mamba安装


conda install -c conda-forge mamba
==> WARNING: A newer version of conda exists. <==
  current version: 22.9.0
  latest version: 22.11.1
Please update conda by running
    $ conda update -n base -c https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge conda
## Package Plan ##
  environment location: /home/livingbody/miniconda3
  added / updated specs:
    - mamba
The following packages will be downloaded:
    package                    |            build
    ---------------------------|-----------------
    c-ares-1.18.1              |       h7f98852_0         113 KB  conda-forge
    ca-certificates-2022.12.7  |       ha878542_0         143 KB  conda-forge
    certifi-2022.12.7          |     pyhd8ed1ab_0         147 KB  conda-forge
    colorama-0.4.6             |     pyhd8ed1ab_0          25 KB  conda-forge
    conda-22.11.1              |   py39hf3d152e_1         904 KB  conda-forge
    fmt-9.1.0                  |       h924138e_0         185 KB  conda-forge
    icu-70.1                   |       h27087fc_0        13.5 MB  conda-forge
    keyutils-1.6.1             |       h166bdaf_0         115 KB  conda-forge
    krb5-1.20.1                |       h81ceb04_0         1.3 MB  conda-forge
...


2.变量设置


替换conda为mamba

(base) livingbody@gaint:~$ CONDA_EXE=mamba


3.软件包安装


(base) livingbody@gaint:~$ conda activate p2
(p2) livingbody@gaint:~$ CONDA_EXE=mamba
(p2) livingbody@gaint:~$ conda install paddlepaddle-gpu==2.4.1 cudatoolkit=11.7 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ 
                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝
        mamba (1.1.0) supported by @QuantStack
        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack
█████████████████████████████████████████████████████████████
Looking for: ['paddlepaddle-gpu==2.4.1', 'cudatoolkit=11.7']
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cl..            No change
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cl..            No change
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pk..            No change
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pk..            No change
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pk..            No change
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pk..            No change
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cl..            No change
...


4.micromamba 介绍


micromamba是一个小型的纯C++可执行文件,具有足够的功能来引导功能齐全的 conda 环境。


仍处于早期阶段,它的主要用途是连续的集成管道:由于它是单个可执行文件,因此可以大大减少带宽使用并提供快速操作。micromamba支持所有 OR 命令的子集,并从头开始实现命令行界面。mamba``conda

您可以使用以下命令查看所有已实现的命令:micromamba --help

$ micromamba --help
Subcommands:
  shell                       Generate shell init scripts
  create                      Create new environment
  install                     Install packages in active environment
  update                      Update packages in active environment
  repoquery                   Find and analyze packages in active environment or channels
  remove                      Remove packages from active environment
  list                        List packages in active environment
  package                     Extract a package or bundle files into an archive
  clean                       Clean package cache
  config                      Configuration of micromamba
  info                        Information about micromamba
  constructor                 Commands to support using micromamba in constructor
  env                         List environments
  activate                    Activate an environment
  run                         Run an executable in an environment
  ps                          Show, inspect or kill running processes
  auth                        Login or logout of a given host
  search                      Find packages in active environment or channels


目录
相关文章
|
6天前
|
Ubuntu Python
Ubuntu 安装Python3.8
Ubuntu 安装Python3.8
30 0
|
1天前
|
Web App开发 测试技术 C++
Playwright安装与Python集成:探索跨浏览器测试的奇妙世界
Playwright是新兴的跨浏览器测试工具,相比Selenium,它支持Chrome、Firefox、WebKit,执行速度快,选择器更稳定。安装Playwright只需一条`pip install playwright`的命令,随后的`playwright install`会自动添加浏览器,无需处理浏览器驱动问题。这一优势免去了Selenium中匹配驱动的烦恼。文章适合寻求高效自动化测试解决方案的开发者。
10 2
|
3天前
|
关系型数据库 MySQL 数据库
Python Stock安装与使用
Python Stock安装与使用
|
3天前
|
Shell 数据安全/隐私保护 Docker
docker安装anaconda3 python环境
docker安装anaconda3 python环境
10 0
|
4天前
|
数据采集 iOS开发 MacOS
Python及Pycharm安装教程
Python及Pycharm安装教程
18 0
|
14天前
|
Linux Python Windows
Python虚拟环境virtualenv安装保姆级教程(Windows和linux)
Python虚拟环境virtualenv安装保姆级教程(Windows和linux)
|
14天前
|
机器学习/深度学习 数据可视化 数据挖掘
Python绘图工具Matplotlib安装与使用,快速上手
Python绘图工具Matplotlib安装与使用,快速上手
|
14天前
|
Linux Python Windows
python安装pytest
【4月更文挑战第22天】
32 5
|
15天前
|
C++ Python
python安装HLL报错unable to find vcvarsall.bat
通过上述方法之一,你应该能够解决"unable to find vcvarsall.bat"的错误,并成功安装HLL或其他需要编译的Python扩展。确保在安装之前先安装了Visual C++构建工具。
10 0
|
16天前
|
机器学习/深度学习 TensorFlow API
Python安装TensorFlow 2、tf.keras和深度学习模型的定义
Python安装TensorFlow 2、tf.keras和深度学习模型的定义