Skip to content

Instantly share code, notes, and snippets.

@hrushikesh198
Last active September 28, 2024 14:48
Show Gist options
  • Select an option

  • Save hrushikesh198/1baffbbf106191d37e07cab266405b7a to your computer and use it in GitHub Desktop.

Select an option

Save hrushikesh198/1baffbbf106191d37e07cab266405b7a to your computer and use it in GitHub Desktop.

Revisions

  1. hrushikesh198 renamed this gist Feb 2, 2017. 1 changed file with 0 additions and 0 deletions.
  2. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Python2.7, Pip, Virtualenv.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #I will show the steps using Python2.7.13
    If you download a newer version it should work similarly.
    #Installing Python2.7
    If you download a different version it should work similarly.
    ```
    cd ~
    wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
  3. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Python2.7, Pip, Virtualenv.md
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ cd Python-2.7.13
    ./configure
    make altinstall prefix=~/.local/
    ```
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin`
    Add this to PATH. This is very important as all the following steps assume `python2.7` is available in path from `~/.local/bin`.
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin.`
    Add this to PATH. This is very important as the following steps depend on it.

    ```
    export PATH=~/.local/bin:$PATH
  4. hrushikesh198 renamed this gist Feb 2, 2017. 1 changed file with 0 additions and 0 deletions.
  5. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Python2.7 Pip Virtualenv.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ cd Python-2.7.13
    make altinstall prefix=~/.local/
    ```
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin`
    Add this to PATH. This is very important as all the followinf steps assume `python2.7` is available in path from `~/.local/bin`.
    Add this to PATH. This is very important as all the following steps assume `python2.7` is available in path from `~/.local/bin`.

    ```
    export PATH=~/.local/bin:$PATH
    @@ -42,6 +42,7 @@ virtualenv -p ~/.local/bin/python2.7 e1
    virtualenv --relocatable e1
    ## To use e1
    source ~/venv/e1/bin/activate
    ## pip install some libraries inside the env e1
    ## To exit
    deactivate
    ```
  6. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Python2.7 Pip Virtualenv.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,8 @@ You can also create a soft-link to `python2.7` so that `python` command gives yo
    cd ~/.local/bin; ln -s python2.7 python
    ```

    #Lets talk about installing pip.

    #Lets talk about installing pip
    Download the get-pip.py file and install it for the current user.
    It will leave `pip` and `pip2.7` executables in `~/.local/bin`.
    ```
    @@ -30,6 +31,7 @@ wget https://bootstrap.pypa.io/get-pip.py
    python2.7 get-pip.py --user
    ```


    #Setting up Virtualenv and Shipping to another machine
    ```
    pip install virtualenv --user
  7. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions Python2.7 Pip Virtualenv.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    I will show the steps using Python2.7.13 If you download a newer version it should work similarly.
    #I will show the steps using Python2.7.13
    If you download a newer version it should work similarly.
    ```
    cd ~
    wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
    @@ -20,7 +21,7 @@ You can also create a soft-link to `python2.7` so that `python` command gives yo
    cd ~/.local/bin; ln -s python2.7 python
    ```

    Lets talk about installing pip.
    #Lets talk about installing pip.
    Download the get-pip.py file and install it for the current user.
    It will leave `pip` and `pip2.7` executables in `~/.local/bin`.
    ```
    @@ -29,7 +30,7 @@ wget https://bootstrap.pypa.io/get-pip.py
    python2.7 get-pip.py --user
    ```

    Setting up Virtualenv and Shipping to another machine
    #Setting up Virtualenv and Shipping to another machine
    ```
    pip install virtualenv --user
    cd ~
  8. hrushikesh198 renamed this gist Feb 2, 2017. 1 changed file with 23 additions and 3 deletions.
    26 changes: 23 additions & 3 deletions Python2.7 Pip .md → Python2.7 Pip Virtualenv.md
    Original file line number Diff line number Diff line change
    @@ -8,13 +8,14 @@ cd Python-2.7.13
    make altinstall prefix=~/.local/
    ```
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin`
    Add this to PATH
    Add this to PATH. This is very important as all the followinf steps assume `python2.7` is available in path from `~/.local/bin`.

    ```
    export PATH=~/.local/bin:$PATH
    python2.7 # should work fine
    ```
    It is a good idea to add the `export` statement to `~/.bashrc` file to load at login.
    You can also create a soft-link to `python2.7` so that `python` command gives you 2.7
    You can also create a soft-link to `python2.7` so that `python` command gives you v2.7
    ```
    cd ~/.local/bin; ln -s python2.7 python
    ```
    @@ -25,5 +26,24 @@ It will leave `pip` and `pip2.7` executables in `~/.local/bin`.
    ```
    cd ~
    wget https://bootstrap.pypa.io/get-pip.py
    ~/.local/bin/python2.7 get-pip.py --user
    python2.7 get-pip.py --user
    ```

    Setting up Virtualenv and Shipping to another machine
    ```
    pip install virtualenv --user
    cd ~
    mkdir venv
    cd venv
    virtualenv -p ~/.local/bin/python2.7 e1
    virtualenv --relocatable e1
    ## To use e1
    source ~/venv/e1/bin/activate
    ## To exit
    deactivate
    ```

    For shipping it to a different machine
    Copy `~/.local` and `~/venv/e1`.
    You will get your python and installed packages on a different machine inside env `e1`.
    It is a good idea to make a tarball and scp to save some time.
  9. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Python2.7 Pip .md
    Original file line number Diff line number Diff line change
    @@ -27,5 +27,3 @@ cd ~
    wget https://bootstrap.pypa.io/get-pip.py
    ~/.local/bin/python2.7 get-pip.py --user
    ```

    Pip shows some ssl warnings. You can fix those by doing the folowing.
  10. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Python2.7 Pip .md
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ cd ~
    wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
    tar -xzvf Python-2.7.13.tgz
    cd Python-2.7.13
    ./configure --prefix=~
    make altinstall
    ./configure
    make altinstall prefix=~/.local/
    ```
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin`
    Add this to PATH
  11. hrushikesh198 revised this gist Feb 2, 2017. No changes.
  12. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Python2.7 Pip .md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,9 @@ python2.7 # should work fine
    ```
    It is a good idea to add the `export` statement to `~/.bashrc` file to load at login.
    You can also create a soft-link to `python2.7` so that `python` command gives you 2.7
    `cd ~/.local/bin; ln -s python2.7 python`
    ```
    cd ~/.local/bin; ln -s python2.7 python
    ```

    Lets talk about installing pip.
    Download the get-pip.py file and install it for the current user.
  13. hrushikesh198 revised this gist Feb 2, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions Python2.7 Pip .md
    Original file line number Diff line number Diff line change
    @@ -1,29 +1,29 @@
    I will show the steps using Python2.7.13 If you download a newer version it should work similarly.
    `
    ```
    cd ~
    wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
    tar -xzvf Python-2.7.13.tgz
    cd Python-2.7.13
    ./configure --prefix=~
    make altinstall
    `
    ```
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin`
    Add this to PATH
    `
    ```
    export PATH=~/.local/bin:$PATH
    python2.7 # should work fine
    `
    ```
    It is a good idea to add the `export` statement to `~/.bashrc` file to load at login.
    You can also create a soft-link to `python2.7` so that `python` command gives you 2.7
    `cd ~/.local/bin; ln -s python2.7 python`

    Lets talk about installing pip.
    Download the get-pip.py file and install it for the current user.
    It will leave `pip` and `pip2.7` executables in `~/.local/bin`.
    `
    ```
    cd ~
    wget https://bootstrap.pypa.io/get-pip.py
    ~/.local/bin/python2.7 get-pip.py --user
    `
    ```

    Pip shows some ssl warnings. You can fix those by doing the folowing.
  14. hrushikesh198 renamed this gist Feb 2, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  15. hrushikesh198 created this gist Feb 2, 2017.
    29 changes: 29 additions & 0 deletions Python2.7 Pip Installation.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    I will show the steps using Python2.7.13 If you download a newer version it should work similarly.
    `
    cd ~
    wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
    tar -xzvf Python-2.7.13.tgz
    cd Python-2.7.13
    ./configure --prefix=~
    make altinstall
    `
    The `configure` and `make` step takes few minutes. Now python 2.7 would be present in `~/.local/bin`
    Add this to PATH
    `
    export PATH=~/.local/bin:$PATH
    python2.7 # should work fine
    `
    It is a good idea to add the `export` statement to `~/.bashrc` file to load at login.
    You can also create a soft-link to `python2.7` so that `python` command gives you 2.7
    `cd ~/.local/bin; ln -s python2.7 python`

    Lets talk about installing pip.
    Download the get-pip.py file and install it for the current user.
    It will leave `pip` and `pip2.7` executables in `~/.local/bin`.
    `
    cd ~
    wget https://bootstrap.pypa.io/get-pip.py
    ~/.local/bin/python2.7 get-pip.py --user
    `

    Pip shows some ssl warnings. You can fix those by doing the folowing.