Python and Its Package - Environment Management
Python has always been the first choice for many programming tasks. This - of course - debatable since some problems exist in Python world, but let me tell you, in IEEE Spectrum top programming languages, Python is the winner from IEEE Spectrum and Trending category while SQL beats it in Job category.
As a long time developer who use Python since release 2.x (I insist on using Python for the whole curriculum in Universitas Teknologi Digital Indonesia back in 2004), currently I use Miniconda a lot (with conda
as its package and environment manager). Conda is a beautiful piece of software of course. I use it to manage my package and create mine. Using it, I can create an environment with specific Python version and also its own packages. However, when I use it for my software with many packages, It runs quite slow. So, I start to look for a drop in replacement. There goes Mamba!. It comes with faster and better at resolving package dependencies. Here’s the reason why Mamba is faster and better from Mamba Github:
- Parallel downloading of repository data and package files using multi-threading
- libsolv for much faster dependency solving, a state of the art library used in the RPM package manager of Red Hat, Fedora and OpenSUSE
- core parts of mamba are implemented in C++ for maximum efficiency
Installation
To use Mamba, I suggest you to use it from Miniforge. Download and install from that GitHub:
$ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
--2024-03-11 11:30:33-- https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Miniforge3-Linux-x86_64.sh [following]
--2024-03-11 11:30:34-- https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Miniforge3-Linux-x86_64.sh
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/221584272/ef57f62d-fd80-4921-a80d-fd319260a363?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240311%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240311T043035Z&X-Amz-Expires=300&X-Amz-Signature=c6040d063867dffe8a700bfacc47679002b5d424dee058e532c1016e491e95b8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=221584272&response-content-disposition=attachment%3B%20filename%3DMiniforge3-Linux-x86_64.sh&response-content-type=application%2Foctet-stream [following]
--2024-03-11 11:30:35-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/221584272/ef57f62d-fd80-4921-a80d-fd319260a363?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240311%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240311T043035Z&X-Amz-Expires=300&X-Amz-Signature=c6040d063867dffe8a700bfacc47679002b5d424dee058e532c1016e491e95b8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=221584272&response-content-disposition=attachment%3B%20filename%3DMiniforge3-Linux-x86_64.sh&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 84233048 (80M) [application/octet-stream]
Saving to: ‘Miniforge3-Linux-x86_64.sh’
Miniforge3-Linux-x86_64.sh 100%[=====================================================================================>] 80.33M 4.26MB/s in 19s
2024-03-11 11:30:55 (4.23 MB/s) - ‘Miniforge3-Linux-x86_64.sh’ saved [84233048/84233048]
$
Change the file into executable mode:
$ chmod +x Miniforge3-Linux-x86_64.sh
$ ls -la
total 82260
drwxr-xr-x. 2 bpdp bpdp 40 Mar 11 11:30 .
drwxr-xr-x. 5 bpdp bpdp 70 Mar 11 11:29 ..
-rwxr-xr-x. 1 bpdp bpdp 84233048 Dec 21 22:41 Miniforge3-Linux-x86_64.sh
$
Execute, pay attention to the answer for some questions in this screenshoot:
./Miniforge3-Linux-x86_64.sh
Welcome to Miniforge3 23.11.0-0
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
Miniforge installer code uses BSD-3-Clause license as stated below.
Binary packages that come with it have their own licensing terms
and by installing miniforge you agree to the licensing terms of individual
packages as well. They include different OSI-approved licenses including
the GNU General Public License and can be found in pkgs/<pkg-name>/info/licenses
folders.
Miniforge installer comes with a boostrapping executable that is used
when installing miniforge and is deleted after miniforge is installed.
The bootstrapping executable uses micromamba, cli11, cpp-filesystem,
curl, c-ares, krb5, libarchive, libev, lz4, nghttp2, openssl, libsolv,
nlohmann-json, reproc and zstd which are licensed under BSD-3-Clause,
MIT and OpenSSL licenses. Licenses and copyright notices of these
projects can be found at the following URL.
https://github.com/conda-forge/micromamba-feedstock/tree/master/recipe.
=============================================================================
Copyright (c) 2019-2022, conda-forge
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Do you accept the license terms? [yes|no]
>>>
Please answer 'yes' or 'no':'
>>> yes
Miniforge3 will now be installed into this location:
/home/bpdp/miniforge3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/bpdp/miniforge3] >>> /home/bpdp/software/python-dev-tools/miniforge3
PREFIX=/home/bpdp/software/python-dev-tools/miniforge3
Unpacking payload ...
Extracting _libgcc_mutex-0.1-conda_forge.tar.bz2
Extracting ca-certificates-2023.11.17-hbcca054_0.conda
Extracting ld_impl_linux-64-2.40-h41732ed_0.conda
Extracting libstdcxx-ng-13.2.0-h7e041cc_3.conda
Extracting pybind11-abi-4-hd8ed1ab_3.tar.bz2
Extracting python_abi-3.10-4_cp310.conda
Extracting tzdata-2023c-h71feb2d_0.conda
Extracting libgomp-13.2.0-h807b86a_3.conda
Extracting _openmp_mutex-4.5-2_gnu.tar.bz2
Extracting libgcc-ng-13.2.0-h807b86a_3.conda
Extracting bzip2-1.0.8-hd590300_5.conda
Extracting c-ares-1.24.0-hd590300_0.conda
Extracting fmt-10.1.1-h00ab1b0_1.conda
Extracting icu-73.2-h59595ed_0.conda
Extracting keyutils-1.6.1-h166bdaf_0.tar.bz2
Extracting libev-4.33-hd590300_2.conda
Extracting libffi-3.4.2-h7f98852_5.tar.bz2
Extracting libiconv-1.17-hd590300_2.conda
Extracting libnsl-2.0.1-hd590300_0.conda
Extracting libuuid-2.38.1-h0b41bf4_0.conda
Extracting libzlib-1.2.13-hd590300_5.conda
Extracting lz4-c-1.9.4-hcb278e6_0.conda
Extracting lzo-2.10-h516909a_1000.tar.bz2
Extracting ncurses-6.4-h59595ed_2.conda
Extracting openssl-3.2.0-hd590300_1.conda
Extracting reproc-14.2.4.post0-hd590300_1.conda
Extracting xz-5.2.6-h166bdaf_0.tar.bz2
Extracting yaml-cpp-0.8.0-h59595ed_0.conda
Extracting libedit-3.1.20191231-he28a2e2_2.tar.bz2
Extracting libnghttp2-1.58.0-h47da74e_1.conda
Extracting libsolv-0.7.27-hfc55251_0.conda
Extracting libsqlite-3.44.2-h2797004_0.conda
Extracting libssh2-1.11.0-h0841786_0.conda
Extracting libxml2-2.12.3-h232c23b_0.conda
Extracting readline-8.2-h8228510_1.conda
Extracting reproc-cpp-14.2.4.post0-h59595ed_1.conda
Extracting tk-8.6.13-noxft_h4845f30_101.conda
Extracting zstd-1.5.5-hfc55251_0.conda
Extracting krb5-1.21.2-h659d440_0.conda
Extracting libarchive-3.7.2-h2aa1ff5_1.conda
Extracting python-3.10.13-hd12c33a_0_cpython.conda
Extracting libcurl-8.5.0-hca28451_0.conda
Extracting menuinst-2.0.1-py310hff52083_0.conda
Extracting archspec-0.2.2-pyhd8ed1ab_0.conda
Extracting boltons-23.1.1-pyhd8ed1ab_0.conda
Extracting brotli-python-1.1.0-py310hc6cd4ac_1.conda
Extracting certifi-2023.11.17-pyhd8ed1ab_0.conda
Extracting charset-normalizer-3.3.2-pyhd8ed1ab_0.conda
Extracting colorama-0.4.6-pyhd8ed1ab_0.tar.bz2
Extracting distro-1.8.0-pyhd8ed1ab_0.conda
Extracting idna-3.6-pyhd8ed1ab_0.conda
Extracting jsonpointer-2.4-py310hff52083_3.conda
Extracting libmamba-1.5.5-had39da4_0.conda
Extracting packaging-23.2-pyhd8ed1ab_0.conda
Extracting platformdirs-4.1.0-pyhd8ed1ab_0.conda
Extracting pluggy-1.3.0-pyhd8ed1ab_0.conda
Extracting pycosat-0.6.6-py310h2372a71_0.conda
Extracting pycparser-2.21-pyhd8ed1ab_0.tar.bz2
Extracting pysocks-1.7.1-pyha2e5f31_6.tar.bz2
Extracting ruamel.yaml.clib-0.2.7-py310h2372a71_2.conda
Extracting setuptools-68.2.2-pyhd8ed1ab_0.conda
Extracting truststore-0.8.0-pyhd8ed1ab_0.conda
Extracting wheel-0.42.0-pyhd8ed1ab_0.conda
Extracting cffi-1.16.0-py310h2fee648_0.conda
Extracting jsonpatch-1.33-pyhd8ed1ab_0.conda
Extracting libmambapy-1.5.5-py310h39ff949_0.conda
Extracting pip-23.3.2-pyhd8ed1ab_0.conda
Extracting ruamel.yaml-0.18.5-py310h2372a71_0.conda
Extracting tqdm-4.66.1-pyhd8ed1ab_0.conda
Extracting urllib3-2.1.0-pyhd8ed1ab_0.conda
Extracting requests-2.31.0-pyhd8ed1ab_0.conda
Extracting zstandard-0.22.0-py310h1275a96_0.conda
Extracting conda-package-streaming-0.9.0-pyhd8ed1ab_0.conda
Extracting conda-package-handling-2.2.0-pyh38be061_0.conda
Extracting conda-23.11.0-py310hff52083_1.conda
Extracting conda-libmamba-solver-23.12.0-pyhd8ed1ab_0.conda
Extracting mamba-1.5.5-py310h51d5547_0.conda
Installing base environment...
__
__ ______ ___ ____ _____ ___ / /_ ____ _
/ / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
/ /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
/ .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
/_/
Transaction
Prefix: /home/bpdp/software/python-dev-tools/miniforge3
Updating specs:
- conda-forge/linux-64::_libgcc_mutex==0.1=conda_forge[md5=d7c89558ba9fa0495403155b64376d81]
- conda-forge/linux-64::ca-certificates==2023.11.17=hbcca054_0[md5=01ffc8d36f9eba0ce0b3c1955fa780ee]
- conda-forge/linux-64::ld_impl_linux-64==2.40=h41732ed_0[md5=7aca3059a1729aa76c597603f10b0dd3]
- conda-forge/linux-64::libstdcxx-ng==13.2.0=h7e041cc_3[md5=937eaed008f6bf2191c5fe76f87755e9]
- conda-forge/noarch::pybind11-abi==4=hd8ed1ab_3[md5=878f923dd6acc8aeb47a75da6c4098be]
- conda-forge/linux-64::python_abi==3.10=4_cp310[md5=26322ec5d7712c3ded99dd656142b8ce]
- conda-forge/noarch::tzdata==2023c=h71feb2d_0[md5=939e3e74d8be4dac89ce83b20de2492a]
- conda-forge/linux-64::libgomp==13.2.0=h807b86a_3[md5=7124cbb46b13d395bdde68f2d215c989]
- conda-forge/linux-64::_openmp_mutex==4.5=2_gnu[md5=73aaf86a425cc6e73fcf236a5a46396d]
- conda-forge/linux-64::libgcc-ng==13.2.0=h807b86a_3[md5=23fdf1fef05baeb7eadc2aed5fb0011f]
- conda-forge/linux-64::bzip2==1.0.8=hd590300_5[md5=69b8b6202a07720f448be700e300ccf4]
- conda-forge/linux-64::c-ares==1.24.0=hd590300_0[md5=f5842b88e9cbfa177abfaeacd457a45d]
- conda-forge/linux-64::fmt==10.1.1=h00ab1b0_1[md5=50a08d74ca45785f3334b175da23fd82]
- conda-forge/linux-64::icu==73.2=h59595ed_0[md5=cc47e1facc155f91abd89b11e48e72ff]
- conda-forge/linux-64::keyutils==1.6.1=h166bdaf_0[md5=30186d27e2c9fa62b45fb1476b7200e3]
- conda-forge/linux-64::libev==4.33=hd590300_2[md5=172bf1cd1ff8629f2b1179945ed45055]
- conda-forge/linux-64::libffi==3.4.2=h7f98852_5[md5=d645c6d2ac96843a2bfaccd2d62b3ac3]
- conda-forge/linux-64::libiconv==1.17=hd590300_2[md5=d66573916ffcf376178462f1b61c941e]
- conda-forge/linux-64::libnsl==2.0.1=hd590300_0[md5=30fd6e37fe21f86f4bd26d6ee73eeec7]
- conda-forge/linux-64::libuuid==2.38.1=h0b41bf4_0[md5=40b61aab5c7ba9ff276c41cfffe6b80b]
- conda-forge/linux-64::libzlib==1.2.13=hd590300_5[md5=f36c115f1ee199da648e0597ec2047ad]
- conda-forge/linux-64::lz4-c==1.9.4=hcb278e6_0[md5=318b08df404f9c9be5712aaa5a6f0bb0]
- conda-forge/linux-64::lzo==2.10=h516909a_1000[md5=bb14fcb13341b81d5eb386423b9d2bac]
- conda-forge/linux-64::ncurses==6.4=h59595ed_2[md5=7dbaa197d7ba6032caf7ae7f32c1efa0]
- conda-forge/linux-64::openssl==3.2.0=hd590300_1[md5=603827b39ea2b835268adb8c821b8570]
- conda-forge/linux-64::reproc==14.2.4.post0=hd590300_1[md5=82ca53502dfd5a64a80dee76dae14685]
- conda-forge/linux-64::xz==5.2.6=h166bdaf_0[md5=2161070d867d1b1204ea749c8eec4ef0]
- conda-forge/linux-64::yaml-cpp==0.8.0=h59595ed_0[md5=965eaacd7c18eb8361fd12bb9e7a57d7]
- conda-forge/linux-64::libedit==3.1.20191231=he28a2e2_2[md5=4d331e44109e3f0e19b4cb8f9b82f3e1]
- conda-forge/linux-64::libnghttp2==1.58.0=h47da74e_1[md5=700ac6ea6d53d5510591c4344d5c989a]
- conda-forge/linux-64::libsolv==0.7.27=hfc55251_0[md5=7dc82edcd617c399ca7fdb51d993a0c2]
- conda-forge/linux-64::libsqlite==3.44.2=h2797004_0[md5=3b6a9f225c3dbe0d24f4fedd4625c5bf]
- conda-forge/linux-64::libssh2==1.11.0=h0841786_0[md5=1f5a58e686b13bcfde88b93f547d23fe]
- conda-forge/linux-64::libxml2==2.12.3=h232c23b_0[md5=bc6ac4c0cea148d924f621985bc3892b]
- conda-forge/linux-64::readline==8.2=h8228510_1[md5=47d31b792659ce70f470b5c82fdfb7a4]
- conda-forge/linux-64::reproc-cpp==14.2.4.post0=h59595ed_1[md5=715e1d720ec1a03715bebd237972fca5]
- conda-forge/linux-64::tk==8.6.13=noxft_h4845f30_101[md5=d453b98d9c83e71da0741bb0ff4d76bc]
- conda-forge/linux-64::zstd==1.5.5=hfc55251_0[md5=04b88013080254850d6c01ed54810589]
- conda-forge/linux-64::krb5==1.21.2=h659d440_0[md5=cd95826dbd331ed1be26bdf401432844]
- conda-forge/linux-64::libarchive==3.7.2=h2aa1ff5_1[md5=3bf887827d1968275978361a6e405e4f]
- conda-forge/linux-64::python==3.10.13=hd12c33a_0_cpython[md5=f3a8c32aa764c3e7188b4b810fc9d6ce]
- conda-forge/linux-64::libcurl==8.5.0=hca28451_0[md5=7144d5a828e2cae218e0e3c98d8a0aeb]
- conda-forge/linux-64::menuinst==2.0.1=py310hff52083_0[md5=471a72a1214ff4910ab6095936aecdfd]
- conda-forge/noarch::archspec==0.2.2=pyhd8ed1ab_0[md5=0dc2fce00a160271714647c019e3a8a8]
- conda-forge/noarch::boltons==23.1.1=pyhd8ed1ab_0[md5=56febe65315cc388a5d20adf2b39a74d]
- conda-forge/linux-64::brotli-python==1.1.0=py310hc6cd4ac_1[md5=1f95722c94f00b69af69a066c7433714]
- conda-forge/noarch::certifi==2023.11.17=pyhd8ed1ab_0[md5=2011bcf45376341dd1d690263fdbc789]
- conda-forge/noarch::charset-normalizer==3.3.2=pyhd8ed1ab_0[md5=7f4a9e3fcff3f6356ae99244a014da6a]
- conda-forge/noarch::colorama==0.4.6=pyhd8ed1ab_0[md5=3faab06a954c2a04039983f2c4a50d99]
- conda-forge/noarch::distro==1.8.0=pyhd8ed1ab_0[md5=67999c5465064480fa8016d00ac768f6]
- conda-forge/noarch::idna==3.6=pyhd8ed1ab_0[md5=1a76f09108576397c41c0b0c5bd84134]
- conda-forge/linux-64::jsonpointer==2.4=py310hff52083_3[md5=08ec1463dbc5c806a32fc431874032ca]
- conda-forge/linux-64::libmamba==1.5.5=had39da4_0[md5=3a99159f63c866711e67955885087700]
- conda-forge/noarch::packaging==23.2=pyhd8ed1ab_0[md5=79002079284aa895f883c6b7f3f88fd6]
- conda-forge/noarch::platformdirs==4.1.0=pyhd8ed1ab_0[md5=45a5065664da0d1dfa8f8cd2eaf05ab9]
- conda-forge/noarch::pluggy==1.3.0=pyhd8ed1ab_0[md5=2390bd10bed1f3fdc7a537fb5a447d8d]
- conda-forge/linux-64::pycosat==0.6.6=py310h2372a71_0[md5=0adaac9a86d59adae2bc86b3cdef2df1]
- conda-forge/noarch::pycparser==2.21=pyhd8ed1ab_0[md5=076becd9e05608f8dc72757d5f3a91ff]
- conda-forge/noarch::pysocks==1.7.1=pyha2e5f31_6[md5=2a7de29fb590ca14b5243c4c812c8025]
- conda-forge/linux-64::ruamel.yaml.clib==0.2.7=py310h2372a71_2[md5=7c9da9721ee545d57ad759f020172853]
- conda-forge/noarch::setuptools==68.2.2=pyhd8ed1ab_0[md5=fc2166155db840c634a1291a5c35a709]
- conda-forge/noarch::truststore==0.8.0=pyhd8ed1ab_0[md5=08316d001eca8854392cf2837828ea11]
- conda-forge/noarch::wheel==0.42.0=pyhd8ed1ab_0[md5=1cdea58981c5cbc17b51973bcaddcea7]
- conda-forge/linux-64::cffi==1.16.0=py310h2fee648_0[md5=45846a970e71ac98fd327da5d40a0a2c]
- conda-forge/noarch::jsonpatch==1.33=pyhd8ed1ab_0[md5=bfdb7c5c6ad1077c82a69a8642c87aff]
- conda-forge/linux-64::libmambapy==1.5.5=py310h39ff949_0[md5=718fe2d638023e9eaaa2f8e05e1a8185]
- conda-forge/noarch::pip==23.3.2=pyhd8ed1ab_0[md5=8591c748f98dcc02253003533bc2e4b1]
- conda-forge/linux-64::ruamel.yaml==0.18.5=py310h2372a71_0[md5=14fd49048b91c96a8fbf1113a8cc4f49]
- conda-forge/noarch::tqdm==4.66.1=pyhd8ed1ab_0[md5=03c97908b976498dcae97eb4e4f3149c]
- conda-forge/noarch::urllib3==2.1.0=pyhd8ed1ab_0[md5=f8ced8ee63830dec7ecc1be048d1470a]
- conda-forge/noarch::requests==2.31.0=pyhd8ed1ab_0[md5=a30144e4156cdbb236f99ebb49828f8b]
- conda-forge/linux-64::zstandard==0.22.0=py310h1275a96_0[md5=54698ba13cd3494547b289cd86a2176a]
- conda-forge/noarch::conda-package-streaming==0.9.0=pyhd8ed1ab_0[md5=38253361efb303deead3eab39ae9269b]
- conda-forge/noarch::conda-package-handling==2.2.0=pyh38be061_0[md5=8a3ae7f6318376aa08ea753367bb7dd6]
- conda-forge/linux-64::conda==23.11.0=py310hff52083_1[md5=d5278ac990c67d5ed51584998aa16c5a]
- conda-forge/noarch::conda-libmamba-solver==23.12.0=pyhd8ed1ab_0[md5=e877d5150e73a0844ea2939be110c3b1]
- conda-forge/linux-64::mamba==1.5.5=py310h51d5547_0[md5=7e9379ab9a9540195193e3c00b48465b]
Package Version Build Channel Size
───────────────────────────────────────────────────────────────────────────────────────
Install:
───────────────────────────────────────────────────────────────────────────────────────
+ _libgcc_mutex 0.1 conda_forge conda-forge Cached
+ _openmp_mutex 4.5 2_gnu conda-forge Cached
+ archspec 0.2.2 pyhd8ed1ab_0 conda-forge Cached
+ boltons 23.1.1 pyhd8ed1ab_0 conda-forge Cached
+ brotli-python 1.1.0 py310hc6cd4ac_1 conda-forge Cached
+ bzip2 1.0.8 hd590300_5 conda-forge Cached
+ c-ares 1.24.0 hd590300_0 conda-forge Cached
+ ca-certificates 2023.11.17 hbcca054_0 conda-forge Cached
+ certifi 2023.11.17 pyhd8ed1ab_0 conda-forge Cached
+ cffi 1.16.0 py310h2fee648_0 conda-forge Cached
+ charset-normalizer 3.3.2 pyhd8ed1ab_0 conda-forge Cached
+ colorama 0.4.6 pyhd8ed1ab_0 conda-forge Cached
+ conda 23.11.0 py310hff52083_1 conda-forge Cached
+ conda-libmamba-solver 23.12.0 pyhd8ed1ab_0 conda-forge Cached
+ conda-package-handling 2.2.0 pyh38be061_0 conda-forge Cached
+ conda-package-streaming 0.9.0 pyhd8ed1ab_0 conda-forge Cached
+ distro 1.8.0 pyhd8ed1ab_0 conda-forge Cached
+ fmt 10.1.1 h00ab1b0_1 conda-forge Cached
+ icu 73.2 h59595ed_0 conda-forge Cached
+ idna 3.6 pyhd8ed1ab_0 conda-forge Cached
+ jsonpatch 1.33 pyhd8ed1ab_0 conda-forge Cached
+ jsonpointer 2.4 py310hff52083_3 conda-forge Cached
+ keyutils 1.6.1 h166bdaf_0 conda-forge Cached
+ krb5 1.21.2 h659d440_0 conda-forge Cached
+ ld_impl_linux-64 2.40 h41732ed_0 conda-forge Cached
+ libarchive 3.7.2 h2aa1ff5_1 conda-forge Cached
+ libcurl 8.5.0 hca28451_0 conda-forge Cached
+ libedit 3.1.20191231 he28a2e2_2 conda-forge Cached
+ libev 4.33 hd590300_2 conda-forge Cached
+ libffi 3.4.2 h7f98852_5 conda-forge Cached
+ libgcc-ng 13.2.0 h807b86a_3 conda-forge Cached
+ libgomp 13.2.0 h807b86a_3 conda-forge Cached
+ libiconv 1.17 hd590300_2 conda-forge Cached
+ libmamba 1.5.5 had39da4_0 conda-forge Cached
+ libmambapy 1.5.5 py310h39ff949_0 conda-forge Cached
+ libnghttp2 1.58.0 h47da74e_1 conda-forge Cached
+ libnsl 2.0.1 hd590300_0 conda-forge Cached
+ libsolv 0.7.27 hfc55251_0 conda-forge Cached
+ libsqlite 3.44.2 h2797004_0 conda-forge Cached
+ libssh2 1.11.0 h0841786_0 conda-forge Cached
+ libstdcxx-ng 13.2.0 h7e041cc_3 conda-forge Cached
+ libuuid 2.38.1 h0b41bf4_0 conda-forge Cached
+ libxml2 2.12.3 h232c23b_0 conda-forge Cached
+ libzlib 1.2.13 hd590300_5 conda-forge Cached
+ lz4-c 1.9.4 hcb278e6_0 conda-forge Cached
+ lzo 2.10 h516909a_1000 conda-forge Cached
+ mamba 1.5.5 py310h51d5547_0 conda-forge Cached
+ menuinst 2.0.1 py310hff52083_0 conda-forge Cached
+ ncurses 6.4 h59595ed_2 conda-forge Cached
+ openssl 3.2.0 hd590300_1 conda-forge Cached
+ packaging 23.2 pyhd8ed1ab_0 conda-forge Cached
+ pip 23.3.2 pyhd8ed1ab_0 conda-forge Cached
+ platformdirs 4.1.0 pyhd8ed1ab_0 conda-forge Cached
+ pluggy 1.3.0 pyhd8ed1ab_0 conda-forge Cached
+ pybind11-abi 4 hd8ed1ab_3 conda-forge Cached
+ pycosat 0.6.6 py310h2372a71_0 conda-forge Cached
+ pycparser 2.21 pyhd8ed1ab_0 conda-forge Cached
+ pysocks 1.7.1 pyha2e5f31_6 conda-forge Cached
+ python 3.10.13 hd12c33a_0_cpython conda-forge Cached
+ python_abi 3.10 4_cp310 conda-forge Cached
+ readline 8.2 h8228510_1 conda-forge Cached
+ reproc 14.2.4.post0 hd590300_1 conda-forge Cached
+ reproc-cpp 14.2.4.post0 h59595ed_1 conda-forge Cached
+ requests 2.31.0 pyhd8ed1ab_0 conda-forge Cached
+ ruamel.yaml 0.18.5 py310h2372a71_0 conda-forge Cached
+ ruamel.yaml.clib 0.2.7 py310h2372a71_2 conda-forge Cached
+ setuptools 68.2.2 pyhd8ed1ab_0 conda-forge Cached
+ tk 8.6.13 noxft_h4845f30_101 conda-forge Cached
+ tqdm 4.66.1 pyhd8ed1ab_0 conda-forge Cached
+ truststore 0.8.0 pyhd8ed1ab_0 conda-forge Cached
+ tzdata 2023c h71feb2d_0 conda-forge Cached
+ urllib3 2.1.0 pyhd8ed1ab_0 conda-forge Cached
+ wheel 0.42.0 pyhd8ed1ab_0 conda-forge Cached
+ xz 5.2.6 h166bdaf_0 conda-forge Cached
+ yaml-cpp 0.8.0 h59595ed_0 conda-forge Cached
+ zstandard 0.22.0 py310h1275a96_0 conda-forge Cached
+ zstd 1.5.5 hfc55251_0 conda-forge Cached
Summary:
Install: 77 packages
Total download: 0 B
───────────────────────────────────────────────────────────────────────────────────────
Transaction starting
Linking _libgcc_mutex-0.1-conda_forge
Linking ca-certificates-2023.11.17-hbcca054_0
Linking ld_impl_linux-64-2.40-h41732ed_0
Linking libstdcxx-ng-13.2.0-h7e041cc_3
Linking pybind11-abi-4-hd8ed1ab_3
Linking python_abi-3.10-4_cp310
Linking tzdata-2023c-h71feb2d_0
Linking libgomp-13.2.0-h807b86a_3
Linking _openmp_mutex-4.5-2_gnu
Linking libgcc-ng-13.2.0-h807b86a_3
Linking bzip2-1.0.8-hd590300_5
Linking c-ares-1.24.0-hd590300_0
Linking fmt-10.1.1-h00ab1b0_1
Linking icu-73.2-h59595ed_0
Linking keyutils-1.6.1-h166bdaf_0
Linking libev-4.33-hd590300_2
Linking libffi-3.4.2-h7f98852_5
Linking libiconv-1.17-hd590300_2
Linking libnsl-2.0.1-hd590300_0
Linking libuuid-2.38.1-h0b41bf4_0
Linking libzlib-1.2.13-hd590300_5
Linking lz4-c-1.9.4-hcb278e6_0
Linking lzo-2.10-h516909a_1000
Linking ncurses-6.4-h59595ed_2
Linking openssl-3.2.0-hd590300_1
Linking reproc-14.2.4.post0-hd590300_1
Linking xz-5.2.6-h166bdaf_0
Linking yaml-cpp-0.8.0-h59595ed_0
Linking libedit-3.1.20191231-he28a2e2_2
Linking libnghttp2-1.58.0-h47da74e_1
Linking libsolv-0.7.27-hfc55251_0
Linking libsqlite-3.44.2-h2797004_0
Linking libssh2-1.11.0-h0841786_0
Linking libxml2-2.12.3-h232c23b_0
Linking readline-8.2-h8228510_1
Linking reproc-cpp-14.2.4.post0-h59595ed_1
Linking tk-8.6.13-noxft_h4845f30_101
Linking zstd-1.5.5-hfc55251_0
Linking krb5-1.21.2-h659d440_0
Linking libarchive-3.7.2-h2aa1ff5_1
Linking python-3.10.13-hd12c33a_0_cpython
Linking libcurl-8.5.0-hca28451_0
Linking menuinst-2.0.1-py310hff52083_0
Linking archspec-0.2.2-pyhd8ed1ab_0
Linking boltons-23.1.1-pyhd8ed1ab_0
Linking brotli-python-1.1.0-py310hc6cd4ac_1
Linking certifi-2023.11.17-pyhd8ed1ab_0
Linking charset-normalizer-3.3.2-pyhd8ed1ab_0
Linking colorama-0.4.6-pyhd8ed1ab_0
Linking distro-1.8.0-pyhd8ed1ab_0
Linking idna-3.6-pyhd8ed1ab_0
Linking jsonpointer-2.4-py310hff52083_3
Linking libmamba-1.5.5-had39da4_0
Linking packaging-23.2-pyhd8ed1ab_0
Linking platformdirs-4.1.0-pyhd8ed1ab_0
Linking pluggy-1.3.0-pyhd8ed1ab_0
Linking pycosat-0.6.6-py310h2372a71_0
Linking pycparser-2.21-pyhd8ed1ab_0
Linking pysocks-1.7.1-pyha2e5f31_6
Linking ruamel.yaml.clib-0.2.7-py310h2372a71_2
Linking setuptools-68.2.2-pyhd8ed1ab_0
Linking truststore-0.8.0-pyhd8ed1ab_0
Linking wheel-0.42.0-pyhd8ed1ab_0
Linking cffi-1.16.0-py310h2fee648_0
Linking jsonpatch-1.33-pyhd8ed1ab_0
Linking libmambapy-1.5.5-py310h39ff949_0
Linking pip-23.3.2-pyhd8ed1ab_0
Linking ruamel.yaml-0.18.5-py310h2372a71_0
Linking tqdm-4.66.1-pyhd8ed1ab_0
Linking urllib3-2.1.0-pyhd8ed1ab_0
Linking requests-2.31.0-pyhd8ed1ab_0
Linking zstandard-0.22.0-py310h1275a96_0
Linking conda-package-streaming-0.9.0-pyhd8ed1ab_0
Linking conda-package-handling-2.2.0-pyh38be061_0
Linking conda-23.11.0-py310hff52083_1
Linking conda-libmamba-solver-23.12.0-pyhd8ed1ab_0
Linking mamba-1.5.5-py310h51d5547_0
Transaction finished
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:
conda config --set auto_activate_base false
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> no
You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:
eval "$(/home/bpdp/software/python-dev-tools/miniforge3/bin/conda shell.YOUR_SHELL_NAME hook)"
To install conda's shell functions for easier access, first activate, then:
conda init
Thank you for installing Miniforge3!
$
Note that I use Fish shell. if you use bash, just conda init and mamba init, no need to use conda init fish and mamba init fish. Initialize conda
and mamba
(in this order since mamba
uses environment variable from conda
):
$ source /home/bpdp/software/python-dev-tools/miniforge3/etc/fish/conf.d/conda.fish
$ conda init fish
no change /home/bpdp/software/python-dev-tools/miniforge3/condabin/conda
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/conda
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/conda-env
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/activate
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/deactivate
no change /home/bpdp/software/python-dev-tools/miniforge3/etc/profile.d/conda.sh
no change /home/bpdp/software/python-dev-tools/miniforge3/etc/fish/conf.d/conda.fish
no change /home/bpdp/software/python-dev-tools/miniforge3/shell/condabin/Conda.psm1
no change /home/bpdp/software/python-dev-tools/miniforge3/shell/condabin/conda-hook.ps1
no change /home/bpdp/software/python-dev-tools/miniforge3/lib/python3.10/site-packages/xontrib/conda.xsh
no change /home/bpdp/software/python-dev-tools/miniforge3/etc/profile.d/conda.csh
modified /home/bpdp/.config/fish/config.fish
==> For changes to take effect, close and re-open your current shell. <==
$ mamba init fish
no change /home/bpdp/software/python-dev-tools/miniforge3/condabin/conda
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/conda
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/conda-env
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/activate
no change /home/bpdp/software/python-dev-tools/miniforge3/bin/deactivate
no change /home/bpdp/software/python-dev-tools/miniforge3/etc/profile.d/conda.sh
no change /home/bpdp/software/python-dev-tools/miniforge3/etc/fish/conf.d/conda.fish
no change /home/bpdp/software/python-dev-tools/miniforge3/shell/condabin/Conda.psm1
no change /home/bpdp/software/python-dev-tools/miniforge3/shell/condabin/conda-hook.ps1
no change /home/bpdp/software/python-dev-tools/miniforge3/lib/python3.10/site-packages/xontrib/conda.xsh
no change /home/bpdp/software/python-dev-tools/miniforge3/etc/profile.d/conda.csh
modified /home/bpdp/.config/fish/config.fish
==> For changes to take effect, close and re-open your current shell. <==
$
I usually don’t activate software by default, instead I will define some environment variables so that I can source
them whenever I need to. Here, I created a file for environment variables definition:
$ cat ~/env/fish/python-mamba
source /home/bpdp/software/python-dev-tools/miniforge3/etc/fish/conf.d/conda.fish
source /home/bpdp/software/python-dev-tools/miniforge3/etc/fish/conf.d/mamba.fish
set -x PATH "/home/bpdp/software/python-dev-tools/miniforge3/bin" $PATH
$
Usage
Everytime I want to use Python and Mamba, I just source
the file which I created:
$ source ~/env/fish/python-mamba
$
and then I can start using Mamba and Conda. Of course I will use Mamba for this post. Mamba is a drop in replacement for Conda, therefore, it understands and run all Conda parameters.
$ mamba
usage: mamba [-h] [-v] [--no-plugins] [-V] COMMAND ...
conda is a tool for managing and deploying applications, environments and packages.
options:
-h, --help Show this help message and exit.
-v, --verbose Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG logging, four times for TRACE logging.
--no-plugins Disable all plugins that are not built into conda.
-V, --version Show the conda version number and exit.
commands:
The following built-in and plugins subcommands are available.
COMMAND
activate Activate a conda environment.
clean Remove unused packages and caches.
compare Compare packages between conda environments.
config Modify configuration values in .condarc.
create Create a new conda environment from a list of specified packages.
deactivate Deactivate the current active conda environment.
doctor Display a health report for your environment.
env See `conda env --help`.
info Display information about current conda install.
init Initialize conda for shell interaction.
install Install a list of packages into a specified conda environment.
list List installed packages in a conda environment.
notices Retrieve latest channel notifications.
package Create low-level conda packages. (EXPERIMENTAL)
remove (uninstall)
Remove a list of packages from a specified conda environment.
rename Rename an existing environment.
repoquery Advanced search for repodata.
repoquery Query repositories using mamba.
run Run an executable in a conda environment.
search Search for packages and display associated information using the MatchSpec format.
update (upgrade) Update conda packages to the latest compatible version.
$
Let’s create an environment with latest Python version (3.12)
$ mamba create -n py312-de python=3.12
Looking for: ['python=3.12']
conda-forge/noarch 13.8MB @ 1.7MB/s 8.1s
conda-forge/linux-64 33.0MB @ 3.0MB/s 11.0s
Transaction
Prefix: /home/bpdp/software/python-dev-tools/miniforge3/envs/py312-de
Updating specs:
- python=3.12
Package Version Build Channel Size
────────────────────────────────────────────────────────────────────────────
Install:
────────────────────────────────────────────────────────────────────────────
+ _libgcc_mutex 0.1 conda_forge conda-forge Cached
+ ld_impl_linux-64 2.40 h41732ed_0 conda-forge Cached
+ ca-certificates 2024.2.2 hbcca054_0 conda-forge 155kB
+ libgomp 13.2.0 h807b86a_5 conda-forge 420kB
+ _openmp_mutex 4.5 2_gnu conda-forge Cached
+ libgcc-ng 13.2.0 h807b86a_5 conda-forge 771kB
+ libxcrypt 4.4.36 hd590300_1 conda-forge 100kB
+ libexpat 2.6.1 h59595ed_0 conda-forge 74kB
+ libzlib 1.2.13 hd590300_5 conda-forge Cached
+ libffi 3.4.2 h7f98852_5 conda-forge Cached
+ bzip2 1.0.8 hd590300_5 conda-forge Cached
+ ncurses 6.4 h59595ed_2 conda-forge Cached
+ openssl 3.2.1 hd590300_0 conda-forge 3MB
+ libuuid 2.38.1 h0b41bf4_0 conda-forge Cached
+ libnsl 2.0.1 hd590300_0 conda-forge Cached
+ xz 5.2.6 h166bdaf_0 conda-forge Cached
+ tk 8.6.13 noxft_h4845f30_101 conda-forge Cached
+ libsqlite 3.45.1 h2797004_0 conda-forge 859kB
+ readline 8.2 h8228510_1 conda-forge Cached
+ tzdata 2024a h0c530f3_0 conda-forge 120kB
+ python 3.12.2 hab00c5b_0_cpython conda-forge 32MB
+ wheel 0.42.0 pyhd8ed1ab_0 conda-forge Cached
+ setuptools 69.1.1 pyhd8ed1ab_0 conda-forge 470kB
+ pip 24.0 pyhd8ed1ab_0 conda-forge 1MB
Summary:
Install: 24 packages
Total download: 40MB
────────────────────────────────────────────────────────────────────────────
Confirm changes: [Y/n] y
libexpat 73.6kB @ 63.0kB/s 1.2s
libxcrypt 100.4kB @ 84.6kB/s 1.2s
ca-certificates 155.4kB @ 115.9kB/s 1.3s
libgcc-ng 770.5kB @ 451.9kB/s 1.7s
setuptools 469.6kB @ 210.4kB/s 0.5s
libgomp 419.8kB @ 168.4kB/s 2.5s
tzdata 119.8kB @ 46.4kB/s 1.4s
openssl 2.9MB @ 930.5kB/s 1.7s
pip 1.4MB @ 436.9kB/s 2.0s
libsqlite 859.3kB @ 240.7kB/s 1.3s
python 32.3MB @ 3.0MB/s 8.3s
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
To activate this environment, use
$ mamba activate py312-de
To deactivate an active environment, use
$ mamba deactivate
$
After environment creation, we may activate it using:
$ mamba activate py312-de
$ python
Python 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:50:58) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
That’s the end of the beginning of Python adventure using Mamba. Have fun and happy coding!