distutils linux script installation broken?

Discussion in 'Python' started by Cory Davis, Jan 12, 2005.

  1. Cory Davis

    Cory Davis Guest

    Hi all,
    I have been successfully deploying my own python package with distutils
    for some time now, but lately, with Python 2.4, the build_scripts
    command has been behaving badly. In the part where it is supposed to
    adjust the first line of the script it now produces

    #!None

    instead of

    #!/whereverpythonis/python

    Has anyone else encountered this?

    Cheers,
    Cory.
     
    Cory Davis, Jan 12, 2005
    #1
    1. Advertising

  2. On Wed, 12 Jan 2005 10:09:03 +0000, Cory Davis <> wrote:
    > command has been behaving badly. In the part where it is supposed to
    > adjust the first line of the script it now produces
    >
    > #!None
    >
    > instead of
    >
    > #!/whereverpythonis/python
    >
    > Has anyone else encountered this?


    I haven't (as I am not using 2.4 :) )

    However, there is an easy way around this, just use

    #!/usr/bin env python

    instead.


    Albert
    --
    Unlike popular belief, the .doc format is not an open publically available format.
     
    Albert Hofkamp, Jan 12, 2005
    #2
    1. Advertising

  3. Cory Davis

    Cory Davis Guest

    Thanks Albert.
    I already do use #!/usr/bin/env python in my package directory, but the
    build_scripts part of "setup.py install" changes this line to #!None
    before copying to my bin directory.

    Cheers,
    Cory.

    Albert Hofkamp wrote:
    > On Wed, 12 Jan 2005 10:09:03 +0000, Cory Davis <> wrote:
    >
    >>command has been behaving badly. In the part where it is supposed to
    >>adjust the first line of the script it now produces
    >>
    >>#!None
    >>
    >>instead of
    >>
    >>#!/whereverpythonis/python
    >>
    >>Has anyone else encountered this?

    >
    >
    > I haven't (as I am not using 2.4 :) )
    >
    > However, there is an easy way around this, just use
    >
    > #!/usr/bin env python
    >
    > instead.
    >
    >
    > Albert
     
    Cory Davis, Jan 12, 2005
    #3
  4. I just installed python2.4 and used it to install a set of scripts I
    had previously been using distutils with. It worked fine, and replaced
    the first line with:

    #!/usr/local/bin/python2.4

    distutils should replace that first line with the location of the
    binary used to run setup.py. Are you running setup with the following
    command line?

    python setup.py install
     
    Christopher De Vries, Jan 12, 2005
    #4
  5. Cory Davis

    Cory Davis Guest

    Hi Christopher

    > distutils should replace that first line with the location of the
    > binary used to run setup.py. Are you running setup with the following
    > command line?
    >
    > python setup.py install
    >


    Yes.

    A possible complication is that I also have python 2.3.? on that
    machine, which I am reluctant to remove incase it disturbs my linux
    distribution (Fedora Core 2).
    Its also possible that I have done something silly to an environment
    variable. To check this I will try installing my package either as root
    or another user.

    Cheers,
    Cory.
     
    Cory Davis, Jan 12, 2005
    #5
  6. I've got python 2.3.3, 2.4, and 1.5.2 (which came preinstalled) on my
    linux box. It's redhat 7.2 (I know... I would upgrade, but it would
    void my service contract, so I just install things in /usr/local). You
    can check if PYTHONHOME or PYTHONPATH are set, which may somehow be
    interfering. I don't have those variables set. If they are set, you
    could try running:

    python -E setup.py install

    The -E option should make python ignore those environment variables.
    Good luck, I hope this helps.

    Chris
     
    Christopher De Vries, Jan 12, 2005
    #6
  7. Cory Davis

    Cory Davis Guest

    Thanks for the help Chris. I tried the -E option, and also installing as
    root with no change - the scripts in the bin directory still end up with
    #!None on the first line. Next step is to reinstall Python 2.4, and if
    that doesn't work I'll just stick with 2.3.4.

    Cheers,
    Cory.

    Christopher De Vries wrote:
    > I've got python 2.3.3, 2.4, and 1.5.2 (which came preinstalled) on my
    > linux box. It's redhat 7.2 (I know... I would upgrade, but it would
    > void my service contract, so I just install things in /usr/local). You
    > can check if PYTHONHOME or PYTHONPATH are set, which may somehow be
    > interfering. I don't have those variables set. If they are set, you
    > could try running:
    >
    > python -E setup.py install
    >
    > The -E option should make python ignore those environment variables.
    > Good luck, I hope this helps.
    >
    > Chris
    >
     
    Cory Davis, Jan 13, 2005
    #7
  8. Cory Davis

    Cory Davis Guest

    Re: distutils linux script installation broken? Sorted

    Problem solved. I was actually using scipy_distutils and not distutils,
    without good reason. Changing setup.py to use distutils made the
    problem go away.

    Cory.

    Cory Davis wrote:
    > Hi all,
    > I have been successfully deploying my own python package with distutils
    > for some time now, but lately, with Python 2.4, the build_scripts
    > command has been behaving badly. In the part where it is supposed to
    > adjust the first line of the script it now produces
    >
    > #!None
    >
    > instead of
    >
    > #!/whereverpythonis/python
    >
    > Has anyone else encountered this?
    >
    > Cheers,
    > Cory.
    >
     
    Cory Davis, Jan 14, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeremy Sanders
    Replies:
    0
    Views:
    286
    Jeremy Sanders
    Nov 23, 2004
  2. timw.google
    Replies:
    1
    Views:
    552
    Serge Orlov
    May 11, 2006
  3. David Abrahams

    distutils/setuptools de-installation?

    David Abrahams, Jun 26, 2007, in forum: Python
    Replies:
    0
    Views:
    257
    David Abrahams
    Jun 26, 2007
  4. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,341
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
  5. John Ladasky
    Replies:
    3
    Views:
    1,170
    John Ladasky
    Jan 25, 2010
Loading...

Share This Page