从头开始快速安装/配置全新的Miniconda发行版。
项目描述
一个从零开始快速制作/配置全新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 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | dbf23494ef15996321b7e0defb4cb900182a18a8118ae2a1ed1507ead5cbef10 |
|
MD5 | e56f407f4d24b4a0a866c327593e5e17 |
|
BLAKE2b-256 | 6fb1251384c31dea48088b9b5daa7170a9c0d547a1f8cdef2c1d9323ca2c29d2 |