Running python from a usb drive

Jordan jordan.taylor2 at gmail.com
Mon Sep 11 15:01:36 EDT 2006


If making a usb version of python was that easy, movable python would
be open source.  Check out http://www.voidspace.org.uk/python/movpy/ if
you need a portable usb version of python for work or something.
Copying the Python24 directory is a good start, but doesn't include the
enormous number of registry keys that are included in the install and
are probably needed for the complete capabilites of python.  I really
hope I didn't missunderstand what you were asking about -_-;
Environmental Variables? Try setting the user/system variable
"pythonpath"
cjl wrote:
> Hey:
>
> I am trying to run python from a usb drive under windows xp. I
> installed python "for this user" on to a machine, then copied the
> entire Python24 directory to the usb drive.
>
> I have the following in a batch file at the root of the drive:
>
> @path=%PATH%;%CD%Python24;%CD%Python24\libs;%CD%Python24\Scripts;%CD%Python24\Lib\site-packages;%CD%Python24\DLLs
> @set pythonpath = %CD%Python24
> @cmd
>
> When I double click the file and type 'python' at the prompt I am in a
> working python environment, and I am able to import modules in the
> site-packages directory (in this case, django).
>
> However, when I run a script directly from the cmd prompt (in this case
> 'django-admin.py' the script runs, but fails to import modules from the
> site-packages directory.
>
> Is there a command line option to python.exe or an environment variable
> I can set to remedy this?
> 
> Any other thoughts?
> 
> Thanks in advance,
> CJL




More information about the Python-list mailing list