Installing modules (SciPy) without root permission.

Steve Holden sholden at holdenweb.com
Mon Aug 5 07:59:45 EDT 2002


"Jacek Generowicz" <jacek.generowicz at cern.ch> wrote in message
news:tyfhei9ipnj.fsf at pcitapi22.cern.ch...
> A while ago I introduced someone (who occasionally wrote some Fortran,
> and maybe plotted some results with matlab) to Python, as a means of
> making efficient use of a computer. The experiment seems to have been
> successful, because I am now being asked for advice on doing some more
> things in python.
>
Congratulations on your successful evangelism!!

> I think that SciPy would be useful at this point, but it is not
> available on the machines where we might be working ... this brings me
> to observe two points:
>
>
> 1) I often find myself in an environment where the local python
>    installation does not have a module I wish to use (usually
>    Numeric), and where I do not have write access to the python
>    installation directories.
>
>    Is there a way to add such modules without re-installing python in
>    my own space ?
>
Indeed. You should inderstand the module-loading mechanism a little better,
or at least relise that the sys.path variable contains a list of directories
that will be searched for a desired module.

> 2) I have been meaning to check-out SciPy for a while now, but the
>    installation process seems almost fractal; each required package
>    itself requires some packages, each of which requires ...  :-) As
>    SciPy is not essential to me, I have not been sufficiently
>    motivated to coplete this process (my strongest effort ground to a
>    halt with gtk incompatibiliy problems, IIRC).
>
>    Is installing SciPy really as painful as it seems ?  (If so, is
>    there any hope that it will become easier ?)
>
Can't answer this, as I'm not a SciPy user. It does seem to be actively
maintained, though, so you could press for better documnetation on the
required dependencies.
>
> If I am to convince my (reluctant computer user) friend that using
> SciPy might be a good idea, the whole process can't start by wasting a
> whole afternoon (day, week ...) on merely installing it (something
> which he would have to do "back home").
>
Agreed.
>
> I'd appreciate useful suggestions ...
>

Well, the easy way would be to install the module in a user directory. Then
you only have to make sure that the sys.path contains that directory, which
you can do in many ways.

It might be helpful if you could persuade your system administrators to add
something like

    sys.path.append("~/python-modules")

into the local sitecustomize.py, allowing users to add their own modules in
a directory with a predictable name. (You'd probably want to expand the
user's home directory before adding the directory to the path). This
wouldn't help your buddy "back home" though, as he would need to ensure he
too got an appropriate new value on sys.path. Worst case, this can be done
inline in each of his programs.

If the modules you are looking at installing use the distutils for
installation you will need to learn the command-line option to have the
modules installed in a non-default directory.

regards
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list