当前位置: 首页 > article >正文

轻松拿捏!windows系统上安装Mamba

windows系统上安装Mamba

一、简介

micromamba 是一个快速、小巧的包管理和环境管理工具,专为数据科学、机器学习和开发人员设计,用来替代 condamamba。它主要用于管理 Python 包和创建隔离的工作环境,确保每个项目可以独立运行,不会受其他项目的依赖冲突影响。

什么是 micromamba?
  • 轻量级:micromamba 体积小,不像 conda 那样需要安装一个庞大的 Anaconda 或 Miniconda。
  • 速度快:使用 C++ 编写,安装包和创建环境的速度比 conda 更快。
  • 跨平台:支持 Windows、Linux 和 macOS,适合各种操作系统。
micromamba 的基本用途
  • 包管理:下载和安装 Python 包(例如 NumPyPandasTensorFlow 等),还能管理 R 和其他语言的包。
  • 环境管理:创建独立的虚拟环境,每个环境可以有不同的 Python 版本和包,不会相互干扰。
为什么选择 micromamba?
  • 更高效:micromamba 不仅安装和更新包更快,还减少了系统资源占用。
  • 便携性:因为是一个单独的可执行文件,只需下载 micromamba.exe 即可使用,不需要额外安装 Anaconda
  • 适合服务器环境:在服务器或无管理员权限的系统中也可以使用,适合在云环境中快速搭建环境。

二、window安装实操

① 打开cmd,输入以下代码:

powershell

② 下载相应压缩包(可选:cd到指定路径再下载):

Invoke-WebRequest -URI https://micro.mamba.pm/api/micromamba/win-64/latest -OutFile micromamba.tar.bz2
tar xf micromamba.tar.bz2
Move-Item -Force Library\bin\micromamba.exe micromamba.exe

③ 设置安装路径,小编设置的是在C:\micromambaenv

$Env:MAMBA_ROOT_PREFIX="C:\micromambaenv"

④ 执行安装。运行以下命令以初始化 micromamba,让其在 PowerShell 中生效:

.\micromamba.exe shell hook -s powershell | Out-String | Invoke-Expression
.\micromamba.exe shell init -s powershell C:\micromambaenv

⑤ 最后运行以下代码检查一下有没有安装成功:

micromamba

输出如下:

Version: 2.0.2

Usage: C:\Users\30768\micromamba.exe [OPTIONS] [SUBCOMMAND]

Options:
  -h,--help                   Print this help message and exit
  --version


Configuration options:
  --rc-file TEXT ...          Paths to the configuration files to use
  --no-rc                     Disable the use of configuration files
  --no-env                    Disable the use of environment variables


Global options:
  -v,--verbose                Set verbosity (higher verbosity with multiple -v, e.g. -vvv)
  --log-level ENUM:value in {critical->5,debug->1,error->4,info->2,off->6,trace->0,warning->3} OR {5,1,4,2,6,0,3}
                              Set the log level
  -q,--quiet                  Set quiet mode (print less output)
  -y,--yes                    Automatically answer yes on prompted questions
  --json                      Report all output as json
  --offline                   Force use cached repodata
  --dry-run                   Only display what would have been done
  --download-only             Only download and extract packages, do not link them into environment.
  --experimental              Enable experimental features


Prefix options:
  -r,--root-prefix TEXT       Path to the root prefix
  -p,--prefix TEXT            Path to the target prefix
  --relocate-prefix TEXT      Path to the relocation prefix
  -n,--name TEXT              Name of the target prefix

Subcommands:
  shell                       Generate shell init scripts
  create                      Create new environment
  install                     Install packages in active environment
  update                      Update packages in active environment
  self-update                 Update micromamba
  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
                              This is equivalent to `repoquery search` command

分享结束


http://www.kler.cn/a/369444.html

相关文章:

  • 面试阿里、字节全都一面挂,被面试官说我的水平还不如应届生
  • Tangible Software Solutions 出品最准确可靠的源代码转换器
  • Java题集练习4
  • Docker中如何控制服务启动顺序实现探讨
  • 基于SSM+小程序的旅游社交登录管理系统(旅游4)
  • VAE中的“变分”什么
  • HarmonyOS 模块化设计
  • 机器人学习仿真框架
  • linux下xdg-open打开文件
  • 大厂面试真题-说说DDD中的领域驱动事件
  • CSS 常见选择器
  • 图像处理 -- 图像对比度的数学解析
  • 【python Arrow库】一个处理日期和时间的Python库
  • 【iOS】SDWebImage的使用
  • Linux 进程优先级 进程切换
  • 春秋云镜——SQL注入漏洞复现——CVE-2022-4230
  • Maven 空 JAR 的一个案例
  • 【Qt】使用正则表达式,从输入字符串中提取所有符合特定始、末符号的字符串。
  • Python基础之正则表达式
  • 微服务网关之Gateway
  • LSTM(Long Short-Term Memory,长短期记忆网络)在高端局效果如何
  • 完全了解一个asp.net core MVC项目模板
  • Ubuntu如何创建一个子用户并赋与管理员权限
  • tomcat多实例
  • 关于注解@ComponentScan
  • gin入门教程(1) 引言