Installing Python in a path that contains a blank

Hamilton, William whamil1 at entergy.com
Tue May 22 08:19:18 EDT 2007


> From: John Machin
> On 21/05/2007 11:30 PM, Konrad Hinsen wrote:
> > I am trying to install Python from sources in my home directory on a Mac
> > cluster (running MacOS X 10.4.8). The path to my home directory contains
> > a blank, and since the installation procedure insists on getting an
> > absolute path for the prefix, I cannot avoid installing to a path whose
> > name contains a blank. Python does not seem to be prepared for this, as
> > it uses only the part before the blank, resulting in numerous error
> > messages.
> >
> > Does anyone know a workaround?
> >
> 
> On Windows, the workaround for pesky paths (i.e. containing blanks or
> just inconveniently long) is the subst command:
> 
> command-prompt>subst X: "C:\Documents and Settings"
> 
> Thereafter X:\foo can be used wherever "C:\Documents and Settings\foo"
> would otherwise be required.

There's also short filename substitution.  "C:\Documents and Settings\foo"
can be replaced with "C:\docume~1\foo".  In general, you take the first six
non-space characters and append "~<digit>" to it.  I've never run into a
situation where <digit> was anything other than 1, but I'm pretty sure that
you increment it if you have multiple files/directorys in the same directory
that have the same first six non-space characters.  This should work on any
Windows long-filename system where you need 8.3 filenames for backwards
compatibility.

---
-Bill Hamilton



More information about the Python-list mailing list