Table of Content

portable Python project

Portable Python project changed to WinPython now, it is still best portable package in the python community.
website: http://portablepython.com/
download: winpython download

Here is show you how to setup WinPython2.7 and WinPython3.5 on same portable driver using msys env.

1) install WinPython2.7 and WinPython3.5 to portable driver

L:\oldhorse\portableapps\WinPython2.7.10.3
L:\oldhorse\portableapps\WinPython3.5.1.3

2) setup source script

under /usr/local/bin

$ cat portpy2
#!/bin/bash

OLD_PATH="$PATH"
PATH=/portable/WinPython2.7.10.3/python-2.7.10:/portable/WinPython2.7.10.3/python-2.7.10/Scripts:$PATH
export OLD_PATH  PATH
export PS1='(portpy27) \u> \w
$ '

$ cat portpy3
#!/bin/bash

OLD_PATH="$PATH"
PATH=/portable/WinPython3.5.1.3/python-3.5.1:/portable/WinPython3.5.1.3/python-3.5.1/Scripts:$PATH
export OLD_PATH  PATH
export PS1='(portpy3) \u> \w
$ '

3) add alias in /etc/profile

alias ppy2='source /usr/local/bin/portpy2'
alias ppy3='source /usr/local/bin/portpy3'

4) uses WinPython in msys

open WinPython2.7 in one msys terminal

$ ppy2
(portpy2) oldhorse> ~
$ pip -V
pip 8.1.2 from L:\oldhorse\portableapps\WinPython2.7.10.3\python-2.7.10\lib\site-packages (python 2.7)
(portpy2) oldhorse> ~
$ jupyter notebook
[I 17:30:34.910 NotebookApp] Serving notebooks from local directory: l:\oldhorse\portableapps\msys\home\oldhorse
[I 17:30:34.911 NotebookApp] 0 active kernels
[I 17:30:34.911 NotebookApp] The IPython Notebook is running at: http://localhost:8888/
[I 17:30:34.911 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

open WinPython3.5 in another msys terminal

$ ppy3
(portpy3) oldhorse> ~
$ pip -V
pip 8.1.2 from L:\oldhorse\portableapps\WinPython3.5.1.3\python-3.5.1\lib\site-packages (python 3.5)
(portpy3) oldhorse> ~
$ jupyter notebook
[I 17:33:08.342 NotebookApp] The port 8888 is already in use, trying another random port.
[I 17:33:08.392 NotebookApp] Serving notebooks from local directory: l:\oldhorse\portableapps\msys\home\oldhorse
[I 17:33:08.392 NotebookApp] 0 active kernels
[I 17:33:08.393 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/
[I 17:33:08.393 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Conclusion

please notice the jupyter notebook used different port: 8888 for 1st session, 8889 for 2nd session.