A gentleman named Martin had previously been so kind as to package a
2.8.7.1 version of wxPython that could be dropped in a few different
directories to enable portable wxPython. Unfortunately these files
were taken down but he explained to me how he derived them, so I
repeated some of the work on the latest wxPython (2.8.8.1 I believe).
The file list I used is attached at the end of this post.
I captured the list using Process Monitor from Sysinsternals
(
www.sysinternals.com) filtering just for file operations. Exporting
the result to CSV and opening in Excel, then making a pivot table of
the filenames made the list. I removed the obvious temp files and
other files that didn't make sense to yield the final version.
I think it is working since I've been able to easy_install winpdb, a
wx-based debugger for Python, on my Portable Python. Between Portable
Komodo Edit, Portable WinMerge, Portable Python and winpdb, I pretty
much have my favorite full-fledged python development environment on a
stick.
All I'm missing is TortoiseSVN, but that's hard to see a portable
version coming around since it is all context-menu based. Command-
line subversion would suffice, but I prefer not even to run version
control on my source on USB anyway, instead using SyncToy 2.0 Beta
(
http://www.microsoft.com/prophoto/downloads/synctoybeta.aspx) to sync
my source files to my desktop.
I set SyncToy to ignore hidden directories, so the subversion files
don't come across to the USB stick, saving me some space and avoiding
conflict issues with the sync. Synchronization can cause consistency
issues with inter-file dependencies when changes have occurred on both
sides. These consistency issues can destroy subversion's ability to
use the metadata it needs to track changes, so I leave the metadata
out and let subversion's normal mechanisms track the source file
changes once they have been synced back to the desktop.
On to easy_install (
http://peak.telecommunity.com/DevCenter/
EasyInstall). This is a very, very handy tool for any python that is
"isolated" from the normal windows environment. It is a command-line
utility (python package with a wrapper) that will automatically search
for the best and latest version of any package registered with the
python package index online, download and install it for you based
just on the name of the package. While it did not work installing
every package I've tried, it has installed several and some I thought
it might not.
For example, I installed the previously mentioned winpdb by using
easy_install with the command "easy_install winpdb". It grabbed and
installed the latest, which I was able to run with the portable
wxpython.
The only caveat so far with it is that it codes the drive letter in
somewhere in the easy_install runner's configuration, which I have not
yet been able to track down. Easy_install from another PC with a
different drive letter errored out. However, manually running "python
Scripts\easy_install-script.py <package>" yields the desired result in
such a case.
The other note is that I used a command-line that made the portable
python first in the path. PortableApps Command Prompt Portable does
this nicely by letting you modify the shell's path at startup with Data
\Batch\commandprompt.bat. See it's docs for details. Remember to
use %~d0 so the path dynamically determines the drive letter.
This all means that many packages should be able to become portable
just using the easy_install command. Remember, easy_install needs to
be set up using the portable python's .exe, not your system one. As
long as you do that, it will install the packages you specify in the
portable python's site-packages. If you do this from the portable
command prompt, it's easy.
Here is the set of files for wxpython. I don't know if everything is
exactly right, but it's working for me so far.
For those directories that obviously only contain wxpython files, I
haven't listed all of the files.
The Scripts directory also contains .bat versions of the files listed
below. Copy those as well.
C:\Python25\Lib\site-packages
C:\Python25\Lib\site-packages\wx.pth
C:\Python25\Lib\site-packages\wx-2.8-msw-unicode
C:\Python25\Lib\site-packages\wxaddons
C:\Python25\Lib\site-packages\wxversion.py
C:\Python25\msvcr71.dll
C:\Python25\python.exe.manifest
C:\Python25\pythonw.exe.manifest
C:\Python25\Scripts
C:\Python25\Scripts\CreateBatchFiles.py
C:\Python25\Scripts\CreateMacScripts.py
C:\Python25\Scripts\editra
C:\Python25\Scripts\helpviewer
C:\Python25\Scripts\img2png
C:\Python25\Scripts\img2py
C:\Python25\Scripts\img2xpm
C:\Python25\Scripts\pyalacarte
C:\Python25\Scripts\pyalamode
C:\Python25\Scripts\pycrust
C:\Python25\Scripts\pyshell
C:\Python25\Scripts\pywrap
C:\Python25\Scripts\pywxrc
C:\Python25\Scripts\xrced
C:\Python25\unicows.dll
A reference of all of the tools I've used for my Portable Python
environment:
PortableApps.com
http://www.portableapps.com/
Notepad++ Portable
http://portableapps.com/apps/development/notepadpp_portable
Command Prompt Portable
http://portableapps.com/apps/utilities/command_prompt_portable
WinMerge Portable
http://portableapps.com/apps/utilities/winmerge_portable
Komodo Edit Portable
http://www.obsidianproject.co.uk/index.ob?do=komodoport
Process Monitor
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Easy Install
http://peak.telecommunity.com/DevCenter/EasyInstall
wxPython
http://www.wxpython.org/
Winpdb
http://winpdb.org/
SyncToy 2.0 Beta
http://www.microsoft.com/prophoto/downloads/synctoybeta.aspx
Python for .NET
http://pythonnet.sourceforge.net/