473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

distutils linux script installation broken?

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.

Jul 18 '05 #1
7 1601
On Wed, 12 Jan 2005 10:09:03 +0000, Cory Davis <cd********@NOSPstaffmail.ed.ac.uk> 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.
Jul 18 '05 #2
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 <cd********@NOSPstaffmail.ed.ac.uk> 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


Jul 18 '05 #3
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

Jul 18 '05 #4
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.

Jul 18 '05 #5
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

Jul 18 '05 #6
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


Jul 18 '05 #7
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.


Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
3
by: Rick Muller | last post by:
I've been trying to figure out whether there are any plans to add an "uninstall" feature to the Python distutils. Googling has found several people posting the same question, but, to the best of my...
1
by: Sridhar R | last post by:
I learnt that distutils can be used to package python modules and packages. Fine it does that well. Suppose I am writing an python application (not package or module), and suppose that I am...
0
by: Christopher De Vries | last post by:
The predominant operating system in my workplace is Solaris, with a bit of Linux and MacOS X thrown in. As such people expect to install new software with the sequence: ../configure make make...
7
by: Frans Englich | last post by:
This is silly. How do I access data files I've installed with distutils? In a portable, generic way, I want to find out what is the following path on most systems: ...
1
by: George van den Driessche | last post by:
Hi folks, I'm looking at packaging a project I'm working on using distutils. The project is for Windows and contains a COM server which needs registration, so the installer needs to be a little...
2
by: Mardy | last post by:
Hi, the bdist_wininst command of distutils allows me to specify a script to be executed at the end of the installation. That's great, but how can I know the installation path from inside the...
7
by: Eric S. Johansson | last post by:
is there anyway I can, in a setup.py file, set and internal equivalent to the '--install-scripts' commandline option? script installation directory but I don't want on the command line where...
7
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.