customary way of keeping your own Python and module directory in $HOME

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jmg3000@gmail.com

    customary way of keeping your own Python and module directory in $HOME

    What's the customary way to keep your own local Python and package
    directory? For example, when you're on a server where you don't have
    root access, and everything must go in your home directory.

    * What directories do you create?
    * What environment variables do you set?
    * What config files do you keep?
    * Does that setup work with distutils and setuptools? What special
    options do you need to pass to these tools when installing modules for
    everything to work right?

    Please, share your tips.

  • James Stroud

    #2
    Re: customary way of keeping your own Python and module directoryin $HOME

    jmg3000@gmail.c om wrote:
    What's the customary way to keep your own local Python and package
    directory? For example, when you're on a server where you don't have
    root access, and everything must go in your home directory.
    >
    * What directories do you create?
    * What environment variables do you set?
    * What config files do you keep?
    * Does that setup work with distutils and setuptools? What special
    options do you need to pass to these tools when installing modules for
    everything to work right?
    >
    Please, share your tips.
    >
    You can do more than you can imagine as non-root even if you have
    hyper-paranoid sysadmins who don't know how to protect infrastructure
    without shackling the users.

    I don't know about windoze (pro-windoze complainers: yep, I'm spelling
    it wrong on purpose, please complain elsewhere about my anti-windoze
    spelling :P -- If you want to be a pro-windoze speller, take the time to
    give your own answers instead of complaining all the time), but on *nix,
    you can compile python with the "--prefix=" option set to a directory in
    your home dir and install there. Because python is compiled with the
    prefix, you will not need to adjust the path if you add modules to the
    site-packages directory. If you have your own modules, but they aren't
    ready for site-packages, you can alter PYTHONPATH to point at your
    staging directory.

    I recommend having your own python install if you want a comprehensive
    approach. Sometimes you need to build your own Tcl/Tk and blt-wish if
    you have a linux version that predates the python dependency
    requirements, though. If you know the dependencies, its all very
    "configure --prefix= ; make ; make install", with proper settings of
    LD_LIBRARY path.

    Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it?

    James

    Comment

    • jmg3000@gmail.com

      #3
      Re: customary way of keeping your own Python and module directory in $HOME

      On May 14, 6:00 pm, James Stroud <jstr...@mbi.uc la.eduwrote:
      jmg3...@gmail.c om wrote:
      [snip], but on *nix,
      you can compile python with the "--prefix=" option set to a directory in
      your home dir and install there.
      Check.
      I recommend having your own python install if you want a comprehensive
      approach.
      Yup. I dropped the src in ~/src/Python-2.5.1, created a ~/py-2.5.1
      directory, and did

      ../configure --prefix=/home/me/py-2.5.1
      make
      make install

      and it worked fine. The only other step after that was creating a
      symlink:

      cd
      ln -s py-2.5.1 py

      and adding /home/me/py/bin to my $PATH.
      Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it?
      Well, on a server with many other users, they've pretty much gotta
      keep you confined to your home directory.

      My issues have been with keeping a ~/pylib directory for extra
      modules, and reconciling that with setuptools / Easy Install. I'm
      curious to hear how other folks manage their own local module
      directory.

      Comment

      • timw.google

        #4
        Re: customary way of keeping your own Python and module directory in $HOME

        On May 14, 8:55 pm, jmg3...@gmail.c om wrote:
        On May 14, 6:00 pm, James Stroud <jstr...@mbi.uc la.eduwrote:
        >
        jmg3...@gmail.c om wrote:
        [snip], but on *nix,
        you can compile python with the "--prefix=" option set to a directory in
        your home dir and install there.
        >
        Check.
        >
        I recommend having your own python install if you want a comprehensive
        approach.
        >
        Yup. I dropped the src in ~/src/Python-2.5.1, created a ~/py-2.5.1
        directory, and did
        >
        ./configure --prefix=/home/me/py-2.5.1
        make
        make install
        >
        and it worked fine. The only other step after that was creating a
        symlink:
        >
        cd
        ln -s py-2.5.1 py
        >
        and adding /home/me/py/bin to my $PATH.
        >
        Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it?
        >
        Well, on a server with many other users, they've pretty much gotta
        keep you confined to your home directory.
        >
        My issues have been with keeping a ~/pylib directory for extra
        modules, and reconciling that with setuptools / Easy Install. I'm
        curious to hear how other folks manage their own local module
        directory.
        I just do

        ../configure --prefix=$HOME;ma ke;make install

        My PATH has $HOME/bin, and LD_LIBRARY_PATH has $HOME/lib before the
        system bin and lib directories. Everything works just fine. I do the
        same thing for everything else I download for personal use when I want
        to use a more up to date version of what's installed. For Windoze,
        Python gets installed in C:\Python24 (or C:\Python25 now, I guess) and
        you don't need admin rights for that. (Thank you, Python developers!)


        Comment

        • Christopher Arndt

          #5
          Re: customary way of keeping your own Python and module directory in $HOME

          On 15 Mai, 02:55, jmg3...@gmail.c om wrote:
          My issues have been with keeping a ~/pylib directory for extra
          modules, and reconciling that with setuptools / Easy Install. I'm
          curious to hear how other folks manage their own local module
          directory.
          For Python libraries, I use the workingenv.py (search Cheeseshop) for
          keeping a separate environment for every application with all the
          libraries it needs. This is great to dodge problems with two apps
          requiring different, uncompatible versions of the same library, for
          having different staging and production environments, and so on.

          Once you activate an environment (in a shell or in your Python
          script), the PYTHONPATH and the installation directories for distutils
          and easy_install will be adapted automatically.

          Chris

          Comment

          Working...