Skip to content

Instantly share code, notes, and snippets.

@chriswayg
Last active July 17, 2020 06:43
Show Gist options
  • Save chriswayg/4bcc14a1dfd5e5479d604a06cd620b0b to your computer and use it in GitHub Desktop.
Save chriswayg/4bcc14a1dfd5e5479d604a06cd620b0b to your computer and use it in GitHub Desktop.

Revisions

  1. chriswayg revised this gist Jul 17, 2020. 1 changed file with 0 additions and 95 deletions.
    95 changes: 0 additions & 95 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,95 +0,0 @@
    # Install conda Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x
    - at 50 Mbps on a recent Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - Usage: copy one of the two following lines and paste it into your terminal

    ##### Python 3.x

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    ##### Python 2.7

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    - see also: https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

    #### Miniconda quickstart
    - To activate the (base) virt. env. manually in another shell use `conda activate`
    - To create another virtual environment and activate / list / deactivate:

    ```
    conda create --name project1
    conda activate project1
    conda info --envs
    ...
    conda deactivate
    ```

    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    #### Remove in 5 seconds

    ```
    conda deactivate >/dev/null 2>&1; rm -rf ~/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    - see: https://docs.anaconda.com/anaconda/install/uninstall/

    #### The Oneliner split-up with detailed comments

    ```
    # Python version 2 or 3
    v=3;
    # Download latest miniconda 64 bit
    # https://docs.conda.io/en/latest/miniconda.html
    f=Miniconda${v}-latest-MacOSX-x86_64.sh;
    # Use a temporary dir such as: /var/folders/9l/wwt.../T/
    cd $TMPDIR;
    # Use Curl as macOS does not come with wget
    # Options: curl --location --fail --remote-name --silent --show-error
    # switch back to previous dir
    { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } &&
    # Use the miniconda installer to install in silent mode
    bash $TMPDIR/$f -b &&
    # Add miniconda to the PATH, while not enabling auto-activation in every shell
    echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile;
    # Activate a virtual environment in the current shell
    . ~/miniconda${v}/bin/activate
    ```

    ---

    ### Regualar Miniconda install
    The only difference is, that this will add a much bigger section to the .bash_profile, which by default auto-activates the base environment in every shell, unless you disable that with `conda config --set auto_activate_base false`, as added below.

    ##### Python 3.x

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    ##### Python 2.7

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    - based on: https://docs.anaconda.com/anaconda/install/mac-os/#using-the-command-line-install
    - and https://docs.anaconda.com/anaconda/install/silent-mode/

    ### Older versions of macOS or OS X
    - the latest version of Miniconda Python may not work on older OS versions, substitute the following:
    - Mavericks 10.9.5 use `Miniconda3-4.5.11-MacOSX-x86_64.sh` (updates to conda version : 4.8.3, python version : 3.7.2.final.0)
  2. chriswayg revised this gist Jul 17, 2020. 2 changed files with 12 additions and 11 deletions.
    4 changes: 2 additions & 2 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Install conda Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x in less than a minute
    - at 50 Mbps on a recnt Mac, the 50 MB download including install takes about 30 seconds ;-)
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x
    - at 50 Mbps on a recent Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - Usage: copy one of the two following lines and paste it into your terminal
    19 changes: 10 additions & 9 deletions Python-conda-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -5,16 +5,16 @@
    #### Quick Miniconda install
    - Usage: copy one of the two following lines and paste it into your terminal

    ##### Python 2.7
    ##### Python 3.x

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    ##### Python 3.x
    ##### Python 2.7

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    - see also: https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20
    @@ -34,12 +34,13 @@ conda deactivate
    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    #### Remove in 5 seconds
    - https://docs.anaconda.com/anaconda/install/uninstall/

    ```
    conda deactivate >/dev/null 2>&1; rm -rf ~/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    - see: https://docs.anaconda.com/anaconda/install/uninstall/

    #### The Oneliner split-up with detailed comments

    ```
    @@ -74,16 +75,16 @@ echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile;
    ### Regualar Miniconda install
    The only difference is, that this will add a much bigger section to the .bash_profile, which by default auto-activates the base environment in every shell, unless you disable that with `conda config --set auto_activate_base false`, as added below.

    ##### Python 2.7
    ##### Python 3.x

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    ##### Python 3.x
    ##### Python 2.7

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    - based on: https://docs.anaconda.com/anaconda/install/mac-os/#using-the-command-line-install
  3. chriswayg revised this gist Jul 17, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -34,12 +34,13 @@ conda deactivate
    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    #### Remove in 5 seconds
    - https://docs.anaconda.com/anaconda/install/uninstall/

    ```
    conda deactivate >/dev/null 2>&1; rm -rf ~/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    - see: https://docs.anaconda.com/anaconda/install/uninstall/

    #### The Oneliner split-up with detailed comments

    ```
  4. chriswayg revised this gist Jul 17, 2020. 1 changed file with 94 additions and 0 deletions.
    94 changes: 94 additions & 0 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,94 @@
    # Install conda Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x in less than a minute
    - at 50 Mbps on a recnt Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - Usage: copy one of the two following lines and paste it into your terminal

    ##### Python 3.x

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    ##### Python 2.7

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    - see also: https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

    #### Miniconda quickstart
    - To activate the (base) virt. env. manually in another shell use `conda activate`
    - To create another virtual environment and activate / list / deactivate:

    ```
    conda create --name project1
    conda activate project1
    conda info --envs
    ...
    conda deactivate
    ```

    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    #### Remove in 5 seconds
    - https://docs.anaconda.com/anaconda/install/uninstall/

    ```
    conda deactivate >/dev/null 2>&1; rm -rf ~/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    #### The Oneliner split-up with detailed comments

    ```
    # Python version 2 or 3
    v=3;
    # Download latest miniconda 64 bit
    # https://docs.conda.io/en/latest/miniconda.html
    f=Miniconda${v}-latest-MacOSX-x86_64.sh;
    # Use a temporary dir such as: /var/folders/9l/wwt.../T/
    cd $TMPDIR;
    # Use Curl as macOS does not come with wget
    # Options: curl --location --fail --remote-name --silent --show-error
    # switch back to previous dir
    { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } &&
    # Use the miniconda installer to install in silent mode
    bash $TMPDIR/$f -b &&
    # Add miniconda to the PATH, while not enabling auto-activation in every shell
    echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile;
    # Activate a virtual environment in the current shell
    . ~/miniconda${v}/bin/activate
    ```

    ---

    ### Regualar Miniconda install
    The only difference is, that this will add a much bigger section to the .bash_profile, which by default auto-activates the base environment in every shell, unless you disable that with `conda config --set auto_activate_base false`, as added below.

    ##### Python 3.x

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    ##### Python 2.7

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    - based on: https://docs.anaconda.com/anaconda/install/mac-os/#using-the-command-line-install
    - and https://docs.anaconda.com/anaconda/install/silent-mode/

    ### Older versions of macOS or OS X
    - the latest version of Miniconda Python may not work on older OS versions, substitute the following:
    - Mavericks 10.9.5 use `Miniconda3-4.5.11-MacOSX-x86_64.sh` (updates to conda version : 4.8.3, python version : 3.7.2.final.0)
  5. chriswayg revised this gist Jul 17, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Python-conda-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Install conda Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x
    - at 50 Mbps on a recnt Mac, the 50 MB download including install takes about 30 seconds ;-)
    - at 50 Mbps on a recent Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - Usage: copy one of the two following lines and paste it into your terminal
  6. chriswayg renamed this gist Jul 17, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Python-30sec-install.md → Python-conda-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Install conda Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x in less than a minute
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x
    - at 50 Mbps on a recnt Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
  7. chriswayg revised this gist Jul 17, 2020. 1 changed file with 26 additions and 28 deletions.
    54 changes: 26 additions & 28 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Install Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Python 2.7 or 3.x in less than a minute
    # Install conda Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x in less than a minute
    - at 50 Mbps on a recnt Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    @@ -19,14 +19,28 @@ v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://

    - see also: https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

    ##### Remove in 5 seconds
    #### Miniconda quickstart
    - To activate the (base) virt. env. manually in another shell use `conda activate`
    - To create another virtual environment and activate / list / deactivate:

    ```
    conda create --name project1
    conda activate project1
    conda info --envs
    ...
    conda deactivate
    ```

    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    #### Remove in 5 seconds
    - https://docs.anaconda.com/anaconda/install/uninstall/

    ```
    conda deactivate >/dev/null 2>&1; rm -rf ~/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    ### The Oneliner with detailed comments
    #### The Oneliner split-up with detailed comments

    ```
    # Python version 2 or 3
    @@ -55,33 +69,10 @@ echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile;
    ```

    - To activate manually in another shell use `~/miniconda3/bin/activate`
    - To create another virtual environment and activate / list / deactivate

    ```
    conda create --name project1
    conda activate project1
    conda info --envs
    ...
    conda deactivate
    ```

    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    ---
    #### Advantages
    - no need to download Xcode Tools plus Homebrew or MacPorts for a 500 MB install
    - no need to go through all the steps downloading from Python.org and setting up a virtual environment
    - easier to remove than the other options

    ---

    ### Regualar Miniconda install
    The only difference is, that this will add a much bigger section to the .bash_profile, which by default auto-activates the base environment in every shell, unless you disable that, as done below.

    - based on: https://docs.anaconda.com/anaconda/install/mac-os/#using-the-command-line-install
    - and https://docs.anaconda.com/anaconda/install/silent-mode/

    The only difference is, that this will add a much bigger section to the .bash_profile, which by default auto-activates the base environment in every shell, unless you disable that with `conda config --set auto_activate_base false`, as added below.

    ##### Python 2.7

    @@ -94,3 +85,10 @@ v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://
    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    - based on: https://docs.anaconda.com/anaconda/install/mac-os/#using-the-command-line-install
    - and https://docs.anaconda.com/anaconda/install/silent-mode/

    ### Older versions of macOS or OS X
    - the latest version of Miniconda Python may not work on older OS versions, substitute the following:
    - Mavericks 10.9.5 use `Miniconda3-4.5.11-MacOSX-x86_64.sh` (updates to conda version : 4.8.3, python version : 3.7.2.final.0)
  8. chriswayg revised this gist Jul 16, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Install Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Python 2.7 or 3.x in less than a minute
    - at 50 Mbps on a modern computer, the 50 MB download including install takes about 30 seconds ;-)
    - at 50 Mbps on a recnt Mac, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - Usage: copy one of the two following lines and paste it into your terminal
    @@ -23,7 +23,7 @@ v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://
    - https://docs.anaconda.com/anaconda/install/uninstall/

    ```
    conda deactivate; rm -rf /Users/christian/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    conda deactivate >/dev/null 2>&1; rm -rf ~/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    ### The Oneliner with detailed comments
  9. chriswayg revised this gist Jul 16, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -68,6 +68,12 @@ conda deactivate

    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    ---
    #### Advantages
    - no need to download Xcode Tools plus Homebrew or MacPorts for a 500 MB install
    - no need to go through all the steps downloading from Python.org and setting up a virtual environment
    - easier to remove than the other options

    ---

    ### Regualar Miniconda install
  10. chriswayg revised this gist Jul 16, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@
    - at 50 Mbps on a modern computer, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20
    - Usage: copy one of the two following lines and paste it into your terminal

    ##### Python 2.7
    @@ -18,6 +17,8 @@ v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    - see also: https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

    ##### Remove in 5 seconds
    - https://docs.anaconda.com/anaconda/install/uninstall/

  11. chriswayg revised this gist Jul 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install Python in 30 seconds
    # Install Python on macOS in 30 seconds
    ### Oneliner that downloads, installs and activates Python 2.7 or 3.x in less than a minute
    - at 50 Mbps on a modern computer, the 50 MB download including install takes about 30 seconds ;-)

  12. chriswayg revised this gist Jul 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,7 @@ conda deactivate; rm -rf /Users/christian/miniconda{2,3}; sed -i.bak '/. ~\/mini
    v=3;
    # Download latest miniconda 64 bit
    # https://docs.conda.io/en/latest/miniconda.html
    f=Miniconda${v}-latest-MacOSX-x86_64.sh;
    # Use a temporary dir such as: /var/folders/9l/wwt.../T/
  13. chriswayg revised this gist Jul 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@

    #### Quick Miniconda install
    - https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20
    - Usage: copy one of the two following lines and paste it into your terminal

    ##### Python 2.7

  14. chriswayg created this gist Jul 16, 2020.
    87 changes: 87 additions & 0 deletions Python-30sec-install.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,87 @@
    # Install Python in 30 seconds
    ### Oneliner that downloads, installs and activates Python 2.7 or 3.x in less than a minute
    - at 50 Mbps on a modern computer, the 50 MB download including install takes about 30 seconds ;-)

    #### Quick Miniconda install
    - https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

    ##### Python 2.7

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    ##### Python 3.x

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile; . ~/miniconda${v}/bin/activate
    ```

    ##### Remove in 5 seconds
    - https://docs.anaconda.com/anaconda/install/uninstall/

    ```
    conda deactivate; rm -rf /Users/christian/miniconda{2,3}; sed -i.bak '/. ~\/miniconda*/d' ~/.bash_profile
    ```

    ### The Oneliner with detailed comments

    ```
    # Python version 2 or 3
    v=3;
    # Download latest miniconda 64 bit
    f=Miniconda${v}-latest-MacOSX-x86_64.sh;
    # Use a temporary dir such as: /var/folders/9l/wwt.../T/
    cd $TMPDIR;
    # Use Curl as macOS does not come with wget
    # Options: curl --location --fail --remote-name --silent --show-error
    # switch back to previous dir
    { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } &&
    # Use the miniconda installer to install in silent mode
    bash $TMPDIR/$f -b &&
    # Add miniconda to the PATH, while not enabling auto-activation in every shell
    echo ". ~/miniconda${v}/etc/profile.d/conda.sh" >> ~/.bash_profile;
    # Activate a virtual environment in the current shell
    . ~/miniconda${v}/bin/activate
    ```

    - To activate manually in another shell use `~/miniconda3/bin/activate`
    - To create another virtual environment and activate / list / deactivate

    ```
    conda create --name project1
    conda activate project1
    conda info --envs
    ...
    conda deactivate
    ```

    - see more: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

    ---

    ### Regualar Miniconda install
    The only difference is, that this will add a much bigger section to the .bash_profile, which by default auto-activates the base environment in every shell, unless you disable that, as done below.

    - based on: https://docs.anaconda.com/anaconda/install/mac-os/#using-the-command-line-install
    - and https://docs.anaconda.com/anaconda/install/silent-mode/


    ##### Python 2.7

    ```
    v=2; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```

    ##### Python 3.x

    ```
    v=3; f=Miniconda${v}-latest-MacOSX-x86_64.sh; cd $TMPDIR; { curl -LfOsS https://repo.anaconda.com/miniconda/$f ; cd -; } && bash $TMPDIR/$f -b && . ~/miniconda${v}/bin/activate && conda init && conda config --set auto_activate_base false
    ```