跳转到主要内容

从头开始快速安装/配置全新的Miniconda发行版。

项目描述

https://img.shields.io/travis/deeplook/mcinstall/master.svg https://img.shields.io/pypi/pyversions/mcinstall.svg https://img.shields.io/pypi/v/mcinstall.svg https://img.shields.io/pypi/status/mcinstall.svg https://img.shields.io/pypi/format/mcinstall.svg https://img.shields.io/pypi/l/mcinstall.svg https://img.shields.io/badge/platform-unix%20|%20win%20|%20osx%20|%20arm-informational.svg https://img.shields.io/badge/likes-Raspberry%20Pi-%23C51A4A?logo=raspberry%20pi https://img.shields.io/lgtm/alerts/g/deeplook/mcinstall.svg?logo=lgtm&logoWidth=18 https://img.shields.io/lgtm/grade/python/g/deeplook/mcinstall.svg?logo=lgtm&logoWidth=18

一个从零开始快速制作/配置全新Miniconda安装的脚本。

此脚本的目标是快速在不同的操作系统上安装全新的Miniconda,并在CI/CD环境中使用它。它将根据您的操作系统下载Miniconda二进制文件,解压二进制文件并本地安装它。它在MacOS和Linux上测试良好,对Windows有相当的支持,并且还旨在通过Berryconda(遗憾的是不再维护)支持树莓派上的ARM6和ARM7。

此脚本没有外部依赖,但需要使用Python 3.5+运行,只因为这是Rasbian上可能仍然是主流的Python 3版本。

注意。此项目经常在线更新,因此其git历史可能看起来很奇怪...

安装

非常简短,就是pip install mcinstall。更多详细信息请参阅INSTALL.rst

示例用法

如果您像这样运行它

mcinstall ~/Downloads/mc3

它将在macOS上运行类似这样的命令(使用一些默认值和良好的系统自我检查)来创建conda基础安装

bash Miniconda3-latest-MacOSX-x86_64.sh -b -f -p ~/Downloads/mc3

然后可以使用类似这样的命令激活它

source ~/Downloads/mc3/bin/activate

Windows示例

在Windows上,如果您执行此命令

mcinstall %USERPROFILE%\downloads\mc3

它将运行类似这样的命令

start /wait "" Miniconda3-latest-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%USERPROFILE%\downloads\mc3

然后可以使用类似这样的命令激活此conda安装

%USERPROFILE%\mc3\condabin\activate

建议测试

mcinstall --verbose --pip-dependencies jupyter,torch ~/Downloads/torchy
source ~/Downloads/torchy/bin/activate
python -c "import torch; print('ok')"

建议测试依赖文件

$ more ~/Downloads/reqs.txt
asciinema
torch
torchvision

$ more ~/Downloads/env.yml
name: test
channels:
  - conda-forge
dependencies:
  - voila

示例运行(手动将主目录替换为 ~

$ mcinstall --verbose --pip-dependencies jupyter,torch ~/Downloads/torchy
Making directory ~/Downloads/torchy.
Downloading https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh ...
Copying to ~/Downloads/Miniconda3-latest-MacOSX-x86_64.sh ...
Running command: bash ~/Downloads/Miniconda3-latest-MacOSX-x86_64.sh -b -f -p ~/Downloads/torchy
PREFIX=~/Downloads/torchy
Unpacking payload ...
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

[...]

Preparing transaction: ...working... done
Executing transaction: ...working... done
installation finished.

Running command: ~/Downloads/torchy/bin/pip install jupyter
[...]

Running command: ~/Downloads/torchy/bin/pip install torch
[...]

Run this to start using your fresh Miniconda: "source ~/Downloads/torchy/bin/activate".

传递给 pip 的示例命令

mcinstall --verbose --pip-dependencies  pypi_pkg_test --pip-index-url https://test.pypi.org/simple/ ~/Downloads/torchy

传递给 pip 的 extra-index-url 示例命令

mcinstall --verbose --pip-dependencies  pypi_pkg_test --pip-index-url https://test.pypi.org/simpletest/ --pip-extra-index-url https://test.pypi.org/simple/ ~/Downloads/torchy

传递多个 extra-index-url 给 pip 的示例

mcinstall --verbose --pip-dependencies  pypi_pkg_test --pip-index-url https://test.pypi.org/simpletest/ --pip-extra-index-url https://test.pypi.org/simpletest1/,https://test.pypi.org/simple/ ~/Downloads/torchy

示例日志文件(《mcinstall.log》)

wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
mv Miniconda3-latest-MacOSX-x86_64.sh ~/Downloads/Miniconda3-latest-MacOSX-x86_64.sh
bash ~/Downloads/Miniconda3-latest-MacOSX-x86_64.sh -b -f -p ~/Downloads/torchy
source ~/Downloads/torchy/bin/activate
~/Downloads/torchy/bin/pip install jupyter
~/Downloads/torchy/bin/pip install torch

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

mcinstall-0.3.1.tar.gz (6.7 kB 查看哈希值)

上传时间

由以下组织支持