Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markthomas93/f9cce98eaefea8e2fcbfd677bb225dbe to your computer and use it in GitHub Desktop.
Save markthomas93/f9cce98eaefea8e2fcbfd677bb225dbe to your computer and use it in GitHub Desktop.

Revisions

  1. @luzfcb luzfcb revised this gist Mar 30, 2022. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -30,14 +30,14 @@ if ! grep -Eq "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; th
    source "${HOME}/.bashrc"

    # install the python versions listed on python_versions variable
    python_versions="3.10.2 3.9.10 3.8.12 3.7.12 3.6.15 2.7.18"
    python_versions="3.10.4 3.9.12 3.8.13 3.7.13 3.6.15 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.10" to point python3.10.2,
    # "python3.9" to point python3.9.10 and "python2" and "python2.7" to point python2.7.18 and etc
    # set "python", "python3", "python3.10" to point python3.10.4,
    # "python3.9" to point python3.9.12 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global ${python_versions}

    @@ -124,14 +124,14 @@ Close the terminal and open again.

    ```bash
    # install the python versions listed on python_versions variable
    python_versions="3.10.2 3.9.10 3.8.12 3.7.12 3.6.15 2.7.18"
    python_versions="3.10.4 3.9.12 3.8.13 3.7.13 3.6.15 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.10" to point python3.10.2,
    # "python3.9" to point python3.9.10 and "python2" and "python2.7" to point python2.7.18 and etc
    # set "python", "python3", "python3.10" to point python3.10.4,
    # "python3.9" to point python3.9.12 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global ${python_versions}

  2. @luzfcb luzfcb revised this gist Mar 11, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer
    git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git "${HOME}/.pyenv/plugins/pyenv-virtualenvwrapper"

    # add pyenv required configurations on your .bashrc file
    if ! grep -Eq "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PYENV_ROOT="${HOME}/.pyenv"\n export PATH="${PYENV_ROOT}/bin:${PATH}"\n eval "$(pyenv init --path)"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "${HOME}/.bashrc"; else echo -e "\n\npyenv configuration already installed in ${HOME}/.bashrc"; fi
    if ! grep -Eq "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export PYTHON_CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PYENV_ROOT="${HOME}/.pyenv"\n export PATH="${PYENV_ROOT}/bin:${PATH}"\n eval "$(pyenv init --path)"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "${HOME}/.bashrc"; else echo -e "\n\npyenv configuration already installed in ${HOME}/.bashrc"; fi


    # reload .bashrc to run pyenv configurations
    @@ -107,7 +107,7 @@ if command -v pyenv &>/dev/null; then
    export CPPFLAGS="-I${OPEN_SSL_DIR}/include -I${READLINE_DIR}/include -I${SQLITE3_DIR}/include -I${ZLIB_DIR}/include ${CPPFLAGS}"
    export PKG_CONFIG_PATH="${OPEN_SSL_DIR}/lib/pkgconfig:${READLINE_DIR}/lib/pkgconfig:${SQLITE3_DIR}/lib/pkgconfig:${ZLIB_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}"
    export PYTHON_CONFIGURE_OPTS="--enable-shared"
    export CFLAGS="-O2"
    export PYTHON_CFLAGS="-O2"
    # Makes pyenv use aria2c to manage and accelerate the download of the python source code.
    # Useful to avoid problems on slower or unstable internet connection
    export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"
  3. @luzfcb luzfcb revised this gist Jan 20, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ source "${HOME}/.bashrc"
    # upgrade some basic packages and install virtualenv virtualenvwrapper
    # on all python versions
    for version in ${python_versions}; do \
    python"${version:0:3}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    python"${version:0:4}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    done
    ```

    @@ -139,7 +139,7 @@ pyenv global ${python_versions}
    # upgrade some basic packages and install virtualenv virtualenvwrapper
    # on all python versions
    for version in ${python_versions}; do \
    python"${version:0:3}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    python"${version:0:4}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    done

    ```
  4. @luzfcb luzfcb revised this gist Jan 20, 2022. 1 changed file with 9 additions and 7 deletions.
    16 changes: 9 additions & 7 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -30,14 +30,14 @@ if ! grep -Eq "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; th
    source "${HOME}/.bashrc"

    # install the python versions listed on python_versions variable
    python_versions="3.10.1 3.9.9 3.8.11 3.7.11 3.6.14 2.7.18"
    python_versions="3.10.2 3.9.10 3.8.12 3.7.12 3.6.15 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.10" to point python3.10.1,
    # "python3.8" to point python3.8.11 and "python2" and "python2.7" to point python2.7.18 and etc
    # set "python", "python3", "python3.10" to point python3.10.2,
    # "python3.9" to point python3.9.10 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global ${python_versions}

    @@ -53,6 +53,7 @@ done

    After install use the [virtualenvwrapper](#virtualenvwrapper-quick-tutorial) to create virtualenvs.

    # ------------------------------------------------------------------------
    ## OSX

    Install the `Xcode Command Line Tools`
    @@ -123,21 +124,21 @@ Close the terminal and open again.

    ```bash
    # install the python versions listed on python_versions variable
    python_versions="3.10.1 3.9.9 3.8.11 3.7.11 3.6.14 2.7.18"
    python_versions="3.10.2 3.9.10 3.8.12 3.7.12 3.6.15 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.10" to point python3.10.1,
    # "python3.8" to point python3.8.11 and "python2" and "python2.7" to point python2.7.18 and etc
    # set "python", "python3", "python3.10" to point python3.10.2,
    # "python3.9" to point python3.9.10 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global ${python_versions}


    # upgrade some basic packages and install virtualenv virtualenvwrapper
    # on all python versions
    for version in ${python_versions}; do \
    for version in ${python_versions}; do \
    python"${version:0:3}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    done

    @@ -146,6 +147,7 @@ done
    Close the terminal and open again.


    # ------------------------------------------------------------------------

    ## Virtualenvwrapper quick tutorial

  5. @luzfcb luzfcb revised this gist Dec 11, 2021. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -30,13 +30,13 @@ if ! grep -Eq "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; th
    source "${HOME}/.bashrc"

    # install the python versions listed on python_versions variable
    python_versions="3.9.6 3.8.11 3.7.11 3.6.14 2.7.18"
    python_versions="3.10.1 3.9.9 3.8.11 3.7.11 3.6.14 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.9" to point python3.9.6,
    # set "python", "python3", "python3.10" to point python3.10.1,
    # "python3.8" to point python3.8.11 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global ${python_versions}
    @@ -123,13 +123,13 @@ Close the terminal and open again.

    ```bash
    # install the python versions listed on python_versions variable
    python_versions="3.9.6 3.8.11 3.7.11 3.6.14 2.7.18"
    python_versions="3.10.1 3.9.9 3.8.11 3.7.11 3.6.14 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.9" to point python3.9.6,
    # set "python", "python3", "python3.10" to point python3.10.1,
    # "python3.8" to point python3.8.11 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global ${python_versions}
  6. @luzfcb luzfcb revised this gist Jul 7, 2021. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -20,13 +20,14 @@ sudo apt-get install aria2 build-essential curl git libbz2-dev libffi-dev liblzm
    curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

    # install a virtualenvwrapper plugin to pyenv
    git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plugins/pyenv-virtualenvwrapper
    git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git "${HOME}/.pyenv/plugins/pyenv-virtualenvwrapper"

    # add pyenv required configurations on your .bashrc file
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PYENV_ROOT="${HOME}/.pyenv"\n export PATH="${PYENV_ROOT}/bin:${PATH}"\n eval "$(pyenv init --path)"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    if ! grep -Eq "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PYENV_ROOT="${HOME}/.pyenv"\n export PATH="${PYENV_ROOT}/bin:${PATH}"\n eval "$(pyenv init --path)"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "${HOME}/.bashrc"; else echo -e "\n\npyenv configuration already installed in ${HOME}/.bashrc"; fi


    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    source "${HOME}/.bashrc"

    # install the python versions listed on python_versions variable
    python_versions="3.9.6 3.8.11 3.7.11 3.6.14 2.7.18"
    @@ -41,11 +42,11 @@ done
    pyenv global ${python_versions}

    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    source "${HOME}/.bashrc"

    # upgrade some basic packages and install virtualenv virtualenvwrapper
    # on all python versions
    for version in ${python_versions}; do \
    for version in ${python_versions}; do \
    python"${version:0:3}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    done
    ```
  7. @luzfcb luzfcb revised this gist Jul 7, 2021. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -121,23 +121,23 @@ fi
    Close the terminal and open again.

    ```bash
    # download and compile python 3.9.5
    pyenv install 3.9.5
    # download and compile python 3.8.9
    pyenv install 3.8.9
    # download and compile python 3.7.10
    pyenv install 3.7.10
    # download and compile python 3.6.13
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.4,
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18, and etc
    # install the python versions listed on python_versions variable
    python_versions="3.9.6 3.8.11 3.7.11 3.6.14 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.9" to point python3.9.6,
    # "python3.8" to point python3.8.11 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.5 3.8.9 3.7.10 3.6.13 2.7.18
    pyenv global ${python_versions}

    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \

    # upgrade some basic packages and install virtualenv virtualenvwrapper
    # on all python versions
    for version in ${python_versions}; do \
    python"${version:0:3}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    done

    ```
  8. @luzfcb luzfcb revised this gist Jul 7, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -31,8 +31,8 @@ source $HOME/.bashrc
    # install the python versions listed on python_versions variable
    python_versions="3.9.6 3.8.11 3.7.11 3.6.14 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python in parallel
    $(pyenv install --skip-existing "${version}";) &
    # download, compile and install python on the user home
    pyenv install --skip-existing "${version}";
    done

    # set "python", "python3", "python3.9" to point python3.9.6,
  9. @luzfcb luzfcb revised this gist Jul 7, 2021. 1 changed file with 23 additions and 16 deletions.
    39 changes: 23 additions & 16 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -11,35 +11,42 @@ will probably work on other newer versions, with no changes, or with few changes
    # Enter your password when prompted.
    # your user must be allowed to run "sudo"
    sudo bash -c "echo -e 'Starting...\n'"

    sudo apt-get update;
    # install most common python interpreter itself compile dependencies
    sudo apt-get install aria2 build-essential curl git libbz2-dev libffi-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev llvm make tk-dev wget xz-utils zlib1g-dev --yes;

    # install pyenv
    curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

    # install a virtualenvwrapper plugin to pyenv
    git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plugins/pyenv-virtualenvwrapper

    # add pyenv required configurations on your .bashrc file
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PYENV_ROOT="${HOME}/.pyenv"\n export PATH="${PYENV_ROOT}/bin:${PATH}"\n eval "$(pyenv init --path)"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi

    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    # download and compile python 3.9.5
    pyenv install 3.9.5
    # download and compile python 3.8.9
    pyenv install 3.8.9
    # download and compile python 3.7.10
    pyenv install 3.7.10
    # download and compile python 3.6.13
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.5,
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18 and etc

    # install the python versions listed on python_versions variable
    python_versions="3.9.6 3.8.11 3.7.11 3.6.14 2.7.18"
    for version in ${python_versions}; do \
    # download, compile and install python in parallel
    $(pyenv install --skip-existing "${version}";) &
    done

    # set "python", "python3", "python3.9" to point python3.9.6,
    # "python3.8" to point python3.8.11 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.5 3.8.9 3.7.10 3.6.13 2.7.18
    pyenv global ${python_versions}

    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \

    # upgrade some basic packages and install virtualenv virtualenvwrapper
    # on all python versions
    for version in ${python_versions}; do \
    python"${version:0:3}" -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; \
    done
    ```

  10. @luzfcb luzfcb revised this gist May 12, 2021. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -22,8 +22,8 @@ git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plug
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    # download and compile python 3.9.4
    pyenv install 3.9.4
    # download and compile python 3.9.5
    pyenv install 3.9.5
    # download and compile python 3.8.9
    pyenv install 3.8.9
    # download and compile python 3.7.10
    @@ -32,10 +32,10 @@ pyenv install 3.7.10
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.4,
    # set "python", "python3", "python3.9" to point python3.9.5,
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.4 3.8.9 3.7.10 3.6.13 2.7.18
    pyenv global 3.9.5 3.8.9 3.7.10 3.6.13 2.7.18
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    @@ -114,8 +114,8 @@ fi
    Close the terminal and open again.

    ```bash
    # download and compile python 3.9.4
    pyenv install 3.9.4
    # download and compile python 3.9.5
    pyenv install 3.9.5
    # download and compile python 3.8.9
    pyenv install 3.8.9
    # download and compile python 3.7.10
    @@ -127,7 +127,7 @@ pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.4,
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18, and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.4 3.8.9 3.7.10 3.6.13 2.7.18
    pyenv global 3.9.5 3.8.9 3.7.10 3.6.13 2.7.18

    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \
  11. @luzfcb luzfcb revised this gist Apr 17, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ pyenv install 3.7.10
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.0,
    # set "python", "python3", "python3.9" to point python3.9.4,
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.4 3.8.9 3.7.10 3.6.13 2.7.18
  12. @luzfcb luzfcb revised this gist Apr 13, 2021. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -22,20 +22,20 @@ git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plug
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    # download and compile python 3.9.2
    pyenv install 3.9.2
    # download and compile python 3.8.8
    pyenv install 3.8.8
    # download and compile python 3.9.4
    pyenv install 3.9.4
    # download and compile python 3.8.9
    pyenv install 3.8.9
    # download and compile python 3.7.10
    pyenv install 3.7.10
    # download and compile python 3.6.13
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.17
    pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.8 and "python2" and "python2.7" to point python2.7.18 and etc
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.2 3.8.8 3.7.10 3.6.13 2.7.18
    pyenv global 3.9.4 3.8.9 3.7.10 3.6.13 2.7.18
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    @@ -114,20 +114,20 @@ fi
    Close the terminal and open again.

    ```bash
    # download and compile python 3.9.2
    pyenv install 3.9.2
    # download and compile python 3.8.8
    pyenv install 3.8.8
    # download and compile python 3.9.4
    pyenv install 3.9.4
    # download and compile python 3.8.9
    pyenv install 3.8.9
    # download and compile python 3.7.10
    pyenv install 3.7.10
    # download and compile python 3.6.13
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.8 and "python2" and "python2.7" to point python2.7.18, and etc
    pyenv install 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.4,
    # "python3.8" to point python3.8.9 and "python2" and "python2.7" to point python2.7.18, and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.2 3.8.8 3.7.10 3.6.13 2.7.18
    pyenv global 3.9.4 3.8.9 3.7.10 3.6.13 2.7.18

    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \
  13. @luzfcb luzfcb revised this gist Apr 6, 2021. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -80,7 +80,12 @@ touch ${HOME}/.zprofile
    ```


    Add to `${HOME}/.zprofile`, `${HOME}/.bash_profile`, `.bashrc` or `.zshrc`
    ### Add pyenv load scripts on your shell

    Add to `${HOME}/.zprofile`, `${HOME}/.bash_profile`, `.bashrc` or `.zshrc`

    Note: In OSX Catalina and later versions, the default shell is `zsh` and not `bash` anymore, so the configuration file is `${HOME}/.zprofile`


    ```bash
    if command -v pyenv &>/dev/null; then
  14. @luzfcb luzfcb revised this gist Mar 15, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Tested only on Ubuntu 20.04 and KDE Neon User Edition (based on Ubuntu 20.04).
    Tested only on Ubuntu 20.04, KDE Neon User Edition (based on Ubuntu 20.04) and OSX Mojave.

    will probably work on other newer versions, with no changes, or with few changes in non-python dependencies (`apt-get` packages)

  15. @luzfcb luzfcb revised this gist Mar 15, 2021. 1 changed file with 20 additions and 20 deletions.
    40 changes: 20 additions & 20 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -22,20 +22,20 @@ git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plug
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    # download and compile python 3.9.0
    pyenv install 3.9.0
    # download and compile python 3.8.6
    pyenv install 3.8.6
    # download and compile python 3.7.9
    pyenv install 3.7.9
    # download and compile python 3.6.12
    pyenv install 3.6.12
    # download and compile python 3.9.2
    pyenv install 3.9.2
    # download and compile python 3.8.8
    pyenv install 3.8.8
    # download and compile python 3.7.10
    pyenv install 3.7.10
    # download and compile python 3.6.13
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18 and etc
    # "python3.8" to point python3.8.8 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.0 3.8.6 3.7.9 3.6.12 2.7.18
    pyenv global 3.9.2 3.8.8 3.7.10 3.6.13 2.7.18
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    @@ -109,20 +109,20 @@ fi
    Close the terminal and open again.

    ```bash
    # download and compile python 3.9.0
    pyenv install 3.9.0
    # download and compile python 3.8.6
    pyenv install 3.8.6
    # download and compile python 3.7.9
    pyenv install 3.7.9
    # download and compile python 3.6.12
    pyenv install 3.6.12
    # download and compile python 3.9.2
    pyenv install 3.9.2
    # download and compile python 3.8.8
    pyenv install 3.8.8
    # download and compile python 3.7.10
    pyenv install 3.7.10
    # download and compile python 3.6.13
    pyenv install 3.6.13
    # download and compile python 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18, and etc
    # "python3.8" to point python3.8.8 and "python2" and "python2.7" to point python2.7.18, and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.0 3.8.6 3.7.9 3.6.12 2.7.18
    pyenv global 3.9.2 3.8.8 3.7.10 3.6.13 2.7.18

    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \
  16. @luzfcb luzfcb revised this gist Dec 15, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,13 @@ After install use the [virtualenvwrapper](#virtualenvwrapper-quick-tutorial) to

    ## OSX

    Install the `Xcode Command Line Tools`

    ```bash
    xcode-select --install
    ```


    Install `brew` (https://brew.sh/)

    ```bash
  17. @luzfcb luzfcb revised this gist Dec 15, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,8 @@ pyenv install 3.6.12
    # download and compile python 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18 and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.0 3.8.6 3.7.9 3.6.12 2.7.18
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    @@ -113,6 +114,7 @@ pyenv install 3.6.12
    pyenv install 2.7.17
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18, and etc
    # It is useful to have all pythons available globally because it makes it easier for example to use tox to test code against various versions of python
    pyenv global 3.9.0 3.8.6 3.7.9 3.6.12 2.7.18

    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
  18. @luzfcb luzfcb revised this gist Dec 15, 2020. 1 changed file with 29 additions and 13 deletions.
    42 changes: 29 additions & 13 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -22,16 +22,24 @@ git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plug
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    # download and compile python 3.8.5
    pyenv install 3.8.5
    # download and compile python 3.9.0
    pyenv install 3.9.0
    # download and compile python 3.8.6
    pyenv install 3.8.6
    # download and compile python 3.7.9
    pyenv install 3.7.9
    # download and compile python 3.6.12
    pyenv install 3.6.12
    # download and compile python 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.8" to point python3.8.5, and "python2" and "python2.7" to point python2.7.18
    pyenv global 3.8.5 2.7.18
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18
    pyenv global 3.9.0 3.8.6 3.7.9 3.6.12 2.7.18
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \
    done
    ```

    After install use the [virtualenvwrapper](#virtualenvwrapper-quick-tutorial) to create virtualenvs.
    @@ -93,15 +101,23 @@ fi
    Close the terminal and open again.

    ```bash
    # download and compile python 3.8.5
    pyenv install 3.8.5
    # download and compile python 3.9.0
    pyenv install 3.9.0
    # download and compile python 3.8.6
    pyenv install 3.8.6
    # download and compile python 3.7.9
    pyenv install 3.7.9
    # download and compile python 3.6.12
    pyenv install 3.6.12
    # download and compile python 2.7.18
    pyenv install 2.7.18
    # set "python", "python3", "python3.8" to point python3.8.2, and "python2" and "python2.7" to point python2.7.18
    pyenv global 3.8.5 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.9" to point python3.9.0,
    # "python3.8" to point python3.8.6 and "python2" and "python2.7" to point python2.7.18, and etc
    pyenv global 3.9.0 3.8.6 3.7.9 3.6.12 2.7.18

    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    for v in "3.9" "3.8" "3.7" "3.6" "2.7"; do \
    python${v} -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U; pyenv rehash; \
    done

    ```

  19. @luzfcb luzfcb revised this gist Dec 15, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Tested only on Ubuntu 18.04 and KDE Neon User Edition (based on Ubuntu 18.04).
    Tested only on Ubuntu 20.04 and KDE Neon User Edition (based on Ubuntu 20.04).

    will probably work on other newer versions, with no changes, or with few changes in non-python dependencies (`apt-get` packages)

  20. @luzfcb luzfcb revised this gist Aug 16, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,8 @@ python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    ```

    After install use the [virtualenvwrapper](#virtualenvwrapper-quick-tutorial) to create virtualenvs.

    ## OSX

    Install `brew` (https://brew.sh/)
  21. @luzfcb luzfcb revised this gist Aug 14, 2020. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -22,12 +22,12 @@ git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plug
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
    # download and compile python 3.8.2
    pyenv install 3.8.2
    # download and compile python 2.7.17
    # download and compile python 3.8.5
    pyenv install 3.8.5
    # download and compile python 2.7.18
    pyenv install 2.7.17
    # set "python", "python3", "python3.8" to point python3.8.2, and "python2" and "python2.7" to point python2.7.17
    pyenv global 3.8.2 2.7.17
    # set "python", "python3", "python3.8" to point python3.8.5, and "python2" and "python2.7" to point python2.7.18
    pyenv global 3.8.5 2.7.18
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    @@ -91,12 +91,12 @@ fi
    Close the terminal and open again.

    ```bash
    # download and compile python 3.8.2
    pyenv install 3.8.2
    # download and compile python 2.7.17
    pyenv install 2.7.17
    # set "python", "python3", "python3.8" to point python3.8.2, and "python2" and "python2.7" to point python2.7.17
    pyenv global 3.8.2 2.7.17
    # download and compile python 3.8.5
    pyenv install 3.8.5
    # download and compile python 2.7.18
    pyenv install 2.7.18
    # set "python", "python3", "python3.8" to point python3.8.2, and "python2" and "python2.7" to point python2.7.18
    pyenv global 3.8.5 2.7.18

    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
  22. @luzfcb luzfcb revised this gist Jun 6, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,7 @@ Install `brew` (https://brew.sh/)
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    ```

    Install the pyenv, pyenv-virtualenvwrapper and the most common python interpreter itself compile dependencies for OSX

    ```bash
    brew install pyenv pyenv-virtualenvwrapper aria2 openssl readline sqlite3 xz zlib
  23. @luzfcb luzfcb revised this gist Jun 6, 2020. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -165,11 +165,6 @@ mkvirtualenv -p python3.8 -a $(pwd) -r requirements.txt -r requirements2.txt mye

    - Create a virtualenv with python3.8, named it as the current directory, mark the current directory as the virtualenv linked Project Directory to automatically go to the Project Directory when activating it and python libraries from the requirements files.

    ```bash
    echo "cookiecutter>=1.7" > requirements.txt
    echo "ipython" > requirements2.txt
    ```


    ```bash
    mkvirtualenv -p python3.8 -a $(pwd) -r requirements.txt $(basename $(pwd))
  24. @luzfcb luzfcb revised this gist Jun 6, 2020. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -126,6 +126,18 @@ deactivate
    workon myenv
    ```

    TIP: type `workon` and press tab two times to autocomplete

    - Delete the virtualenv

    > it is necessary to deactivate virtualenv first
    ```bash
    rmvirtualenv myenv
    ```



    - Create a virtualenv with python3.8, named it as `myenv2` and mark the current directory as the virtualenv linked Project Directory to automatically go to the Project Directory when activating it.

    ```bash
  25. @luzfcb luzfcb revised this gist Jun 6, 2020. 1 changed file with 95 additions and 6 deletions.
    101 changes: 95 additions & 6 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -44,20 +44,48 @@ Install `brew` (https://brew.sh/)


    ```bash
    brew install pyenv
    brew install pyenv-virtualenvwrapper
    brew install pyenv pyenv-virtualenvwrapper aria2 openssl readline sqlite3 xz zlib
    ```

    Add to `.bash_profile`, `.bashrc` or `.zshrc`
    On OSX Mojave:

    ```
    touch ${HOME}/.bash_profile
    ```


    On OSX Catalina:

    ```
    touch ${HOME}/.zprofile
    ```


    Add to `${HOME}/.zprofile`, `${HOME}/.bash_profile`, `.bashrc` or `.zshrc`

    ```bash
    if command -v pyenv &>/dev/null; then
    ZLIB_DIR="/usr/local/opt/zlib"
    OPEN_SSL_DIR="/usr/local/opt/[email protected]"
    READLINE_DIR="/usr/local/opt/readline"
    SQLITE3_DIR="/usr/local/opt/sqlite"
    export PATH="${OPEN_SSL_DIR}/bin:${SQLITE3_DIR}/bin:$PATH"
    export LDFLAGS="-L${OPEN_SSL_DIR}/lib -L${READLINE_DIR}/lib -L${SQLITE3_DIR}/lib -L${ZLIB_DIR}/lib ${LDFLAGS}"
    export CPPFLAGS="-I${OPEN_SSL_DIR}/include -I${READLINE_DIR}/include -I${SQLITE3_DIR}/include -I${ZLIB_DIR}/include ${CPPFLAGS}"
    export PKG_CONFIG_PATH="${OPEN_SSL_DIR}/lib/pkgconfig:${READLINE_DIR}/lib/pkgconfig:${SQLITE3_DIR}/lib/pkgconfig:${ZLIB_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}"
    export PYTHON_CONFIGURE_OPTS="--enable-shared"
    export CFLAGS="-O2"
    # Makes pyenv use aria2c to manage and accelerate the download of the python source code.
    # Useful to avoid problems on slower or unstable internet connection
    export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"
    # load pyenv
    eval "$(pyenv init -)"
    fi
    if command -v pyenv-virtualenvwrapper &>/dev/null; then
    pyenv virtualenvwrapper
    if command -v pyenv-virtualenvwrapper &>/dev/null && echo $(pyenv which python) | grep -qv "/usr/bin"; then
    pyenv virtualenvwrapper
    fi
    fi


    ```
    Close the terminal and open again.

    @@ -73,3 +101,64 @@ python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U

    ```

    Close the terminal and open again.



    ## Virtualenvwrapper quick tutorial

    - Create a virtualenv with python3.8 and named it as `myenv` and load the virtualenv

    ```bash
    mkvirtualenv -p python3.8 myenv
    ```

    - Unload (deactivate) the virtualenv

    ```bash
    deactivate
    ```

    - Load the virtualenv

    ```bash
    workon myenv
    ```

    - Create a virtualenv with python3.8, named it as `myenv2` and mark the current directory as the virtualenv linked Project Directory to automatically go to the Project Directory when activating it.

    ```bash
    mkvirtualenv -p python3.8 -a $(pwd) myenv2
    ```

    - Create a virtualenv with python3.8, named it as `myenv3`, mark the current directory as the virtualenv linked Project Directory to automatically go to the Project Directory when activating it and install two python libraries

    ```bash
    mkvirtualenv -p python3.8 -a $(pwd) -i cookiecutter -i ipython myenv3
    ```

    - Create a virtualenv with python3.8, named it as `myenv4`, mark the current directory as the virtualenv linked Project Directory to automatically go to the Project Directory when activating it and python libraries from the requirements files.

    ```bash
    echo "cookiecutter>=1.7" > requirements.txt
    echo "ipython" > requirements2.txt
    ```


    ```bash
    mkvirtualenv -p python3.8 -a $(pwd) -r requirements.txt -r requirements2.txt myenv4
    ```


    - Create a virtualenv with python3.8, named it as the current directory, mark the current directory as the virtualenv linked Project Directory to automatically go to the Project Directory when activating it and python libraries from the requirements files.

    ```bash
    echo "cookiecutter>=1.7" > requirements.txt
    echo "ipython" > requirements2.txt
    ```


    ```bash
    mkvirtualenv -p python3.8 -a $(pwd) -r requirements.txt $(basename $(pwd))
    ```
  26. @luzfcb luzfcb revised this gist Jun 5, 2020. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -36,12 +36,6 @@ python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U

    ## OSX

    Install Xcode Command Line Tools

    ```bash
    xcode-select --install
    ```

    Install `brew` (https://brew.sh/)

    ```bash
  27. @luzfcb luzfcb revised this gist Jun 5, 2020. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -36,8 +36,20 @@ python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U

    ## OSX

    Install Xcode Command Line Tools

    ```bash
    xcode-select --install
    ```

    Install `brew` (https://brew.sh/)

    ```bash
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    ```


    ```bash
    brew install pyenv
    brew install pyenv-virtualenvwrapper
    ```
  28. @luzfcb luzfcb revised this gist Jun 5, 2020. 1 changed file with 35 additions and 0 deletions.
    35 changes: 35 additions & 0 deletions installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@ will probably work on other newer versions, with no changes, or with few changes

    > NOTE: Don't create a .sh file and run it all at once. It will not work. Copy, paste, and execute each command below manually. :-)
    ## Ubuntu

    ```bash
    # DO NOT RUN THIS AS A ROOT USER
    @@ -32,3 +33,37 @@ source $HOME/.bashrc
    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    ```

    ## OSX


    ```
    brew install pyenv
    brew install pyenv-virtualenvwrapper
    ```

    Add to `.bash_profile`, `.bashrc` or `.zshrc`

    ```bash
    if command -v pyenv &>/dev/null; then
    eval "$(pyenv init -)"
    fi
    if command -v pyenv-virtualenvwrapper &>/dev/null; then
    pyenv virtualenvwrapper
    fi

    ```
    Close the terminal and open again.

    ```bash
    # download and compile python 3.8.2
    pyenv install 3.8.2
    # download and compile python 2.7.17
    pyenv install 2.7.17
    # set "python", "python3", "python3.8" to point python3.8.2, and "python2" and "python2.7" to point python2.7.17
    pyenv global 3.8.2 2.7.17

    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U
    python2 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U

    ```
  29. @luzfcb luzfcb revised this gist May 27, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ sudo apt-get install aria2 build-essential curl git libbz2-dev libffi-dev liblzm
    curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
    # install a virtualenvwrapper plugin to pyenv
    git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $HOME/.pyenv/plugins/pyenv-virtualenvwrapper
    # add pyenv required configurations
    # add pyenv required configurations on your .bashrc file
    if ! egrep -q "^[#]{4}[[:space:]]pyenv[[:space:]]config$" "${HOME}/.bashrc" ; then echo -e "\n\nsetup pyenv configuration:\nThe following content was inserted at the end of the ${HOME}/.bashrc file\n"; echo -e '\n#### pyenv config\nif [ -f "$HOME/.pyenv/bin/pyenv" ] && ! type -P pyenv &>/dev/null ; then\n export PYTHON_CONFIGURE_OPTS="--enable-shared"\n export CFLAGS="-O2"\n export PYTHON_BUILD_ARIA2_OPTS="-x 10 -k 1M"\n export PATH="$HOME/.pyenv/bin:$PATH"\n eval "$(pyenv init -)"\n eval "$(pyenv virtualenv-init -)"\n if [[ ! "$(pyenv which python)" == "/usr/bin/python" ]] ; then \n pyenv virtualenvwrapper_lazy;\n fi\nfi\n#### pyenv config end' | tee --append "${HOME}/.bashrc"; source "$HOME/.bashrc"; else echo -e "\n\npyenv configuration already installed in $HOME/.bashrc"; fi
    # reload .bashrc to run pyenv configurations
    source $HOME/.bashrc
  30. @luzfcb luzfcb revised this gist Mar 21, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing_pyenv_on_ubuntu_based_distros.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ pyenv install 3.8.2
    # download and compile python 2.7.17
    pyenv install 2.7.17
    # set "python", "python3", "python3.8" to point python3.8.2, and "python2" and "python2.7" to point python2.7.17
    pyenv global 3.8.1 2.7.17
    pyenv global 3.8.2 2.7.17
    # reload .bashrc to run pyenv configurations again
    source $HOME/.bashrc
    python3 -m pip install pip setuptools wheel virtualenv virtualenvwrapper -U