Help with Python install 
Author Message
 Help with Python install

My web host offers python 1.5.1. It is not possible for the host to upgrade at
this time, because it would require an entire rebuild of the server core (the
servers are highly customized).

But I really wanted to use a more recent version. I was given permission to
install 2.0 in my own directory space. I have done so, and it appears to be
working.

The host is running RedHat Linux with Apache as the server. Python 1.5.1 is in
the path, and anyplace I type >python, in any directory, the interpreter comes
up.

Even in the directory where I installed 2.0. To get the 2.0 interpreter to
come up, I have to type the full path. The 2.0 install seems to be running
fine. I used the smtplib and sent myself an e-mail. I added a few numbers.
Printed some messages to the screen. Looks fine.

However...

I can't get some mail scripts that I had running before under 1.5.1 to run
under 2.0.

Using .qmail files I'm invoking these scripts when mail arrives for my
account. The contents of my .qmail file are shown below:
------------------------------------------------
|/big/dom/xthinkspot/mailtofile.py |vdeliver
------------------------------------------------

So, when a mail arrives, it calls the script mailtofile.py and runs that, with
the newly arrived mail being read on stdin.

This is the first version of mailtofile.py:
------------------------------------------------
#! /usr/bin/python

import sys, os

rawmessage = sys.stdin.read()
outfile = open("./outmessage.txt", "w")
sys.stdout=outfile
print rawmessage
outfile.close()
os.chmod("./outmessage.txt", 0664)
------------------------------------------------

When I send an e-mail, it gets copied to the textfile outmessage.txt. No
problem. However, it is running the Python 1.5.1 from my host.

So, I tried changing it to this:

-----------------------------------------------
#! /big/dom/xthinkspot/thinker/python/Python-2.0/python

import sys, os

rawmessage = sys.stdin.read()
outfile = open("./outmessage.txt", "w")
sys.stdout=outfile
print rawmessage
outfile.close()
os.chmod("./outmessage.txt", 0664)
----------------------------------------------

The only thing that has been changed is the path. I have not changed the file
name, or anything else. But this doesn't appear to run at all. Well, the
.qmail file tries to do something. I do get a blank e-mail as a result. But
the python script doesn't appear to do it's thing.

I'm wondering what I need to do? I suppose I need to set my .bash_profile so
that my Python 2.0 is added to my path? or my environment? or something?

Could someone help me out here?

--
Sheila King
http://www.*-*-*.com/
http://www.*-*-*.com/



Fri, 04 Jul 2003 11:12:04 GMT  
 Help with Python install
How about trying the full python2 path in .qmail preceeding
your script file name:

------------------------------------------------
|/big/dom/xthinkspot/thinker/python/Python-2.0/python
/big/dom/xthinkspot/mailtofile.py |vdeliver
------------------------------------------------

--

Emile van Sebille

-------------------


Quote:
> My web host offers Python 1.5.1. It is not possible for

the host to upgrade at
Quote:
> this time, because it would require an entire rebuild of

the server core (the
Quote:
> servers are highly customized).

> But I really wanted to use a more recent version. I was
given permission to
> install 2.0 in my own directory space. I have done so, and
it appears to be
> working.

> The host is running RedHat Linux with Apache as the

server. Python 1.5.1 is in
Quote:
> the path, and anyplace I type >python, in any directory,

the interpreter comes
Quote:
> up.

> Even in the directory where I installed 2.0. To get the
2.0 interpreter to
> come up, I have to type the full path. The 2.0 install
seems to be running
> fine. I used the smtplib and sent myself an e-mail. I

added a few numbers.
Quote:
> Printed some messages to the screen. Looks fine.

> However...

> I can't get some mail scripts that I had running before
under 1.5.1 to run
> under 2.0.

> Using .qmail files I'm invoking these scripts when mail
arrives for my
> account. The contents of my .qmail file are shown below:
> ------------------------------------------------
> |/big/dom/xthinkspot/mailtofile.py |vdeliver
> ------------------------------------------------

> So, when a mail arrives, it calls the script mailtofile.py
and runs that, with
> the newly arrived mail being read on stdin.

> This is the first version of mailtofile.py:
> ------------------------------------------------
> #! /usr/bin/python

> import sys, os

> rawmessage = sys.stdin.read()
> outfile = open("./outmessage.txt", "w")
> sys.stdout=outfile
> print rawmessage
> outfile.close()
> os.chmod("./outmessage.txt", 0664)
> ------------------------------------------------

> When I send an e-mail, it gets copied to the textfile
outmessage.txt. No
> problem. However, it is running the Python 1.5.1 from my
host.

> So, I tried changing it to this:

> -----------------------------------------------
> #! /big/dom/xthinkspot/thinker/python/Python-2.0/python

> import sys, os

> rawmessage = sys.stdin.read()
> outfile = open("./outmessage.txt", "w")
> sys.stdout=outfile
> print rawmessage
> outfile.close()
> os.chmod("./outmessage.txt", 0664)
> ----------------------------------------------

> The only thing that has been changed is the path. I have

not changed the file

- Show quoted text -

Quote:
> name, or anything else. But this doesn't appear to run at
all. Well, the
> .qmail file tries to do something. I do get a blank e-mail
as a result. But
> the python script doesn't appear to do it's thing.

> I'm wondering what I need to do? I suppose I need to set
my .bash_profile so
> that my Python 2.0 is added to my path? or my environment?
or something?

> Could someone help me out here?

> --
> Sheila King
> http://www.thinkspot.net/sheila/
> http://www.k12groups.org/



Fri, 04 Jul 2003 12:02:00 GMT  
 Help with Python install


:How about trying the full python2 path in .qmail preceeding
:your script file name:
:
:------------------------------------------------
:|/big/dom/xthinkspot/thinker/python/Python-2.0/python
:/big/dom/xthinkspot/mailtofile.py |vdeliver
:------------------------------------------------

Thanks for the suggestion. I had tried it before, but I tried it again, at
your suggestion.

Still doesn't work. :-(

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/



Fri, 04 Jul 2003 12:24:46 GMT  
 Help with Python install

Quote:

> Thanks for the suggestion. I had tried it before, but I tried it
> again, at
> your suggestion.

> Still doesn't work. :-(

What you should generally do at this point is do some sanity checks.
What version of Python is it actually running?  Instead of the program
you'd like to run, replace it with a simple little script that prints
information about the Python version.  Once you know where you are you
can go on from there.

--

 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Whoever named it necking was a poor judge of anatomy.
\__/ Groucho Marx
    Official Omega page / http://www.alcyone.com/max/projects/omega/
 The official distribution page for the popular Roguelike, Omega.



Fri, 04 Jul 2003 12:34:08 GMT  
 Help with Python install


:My web host offers Python 1.5.1.
...<snipped>...
:But I really wanted to use a more recent version. I was given permission to
:install 2.0 in my own directory space. I have done so, and it appears to be
:working.
...<snipped>...
:I can't get some mail scripts that I had running before under 1.5.1 to run
:under 2.0.

I've been given a clue from the Sysadmin:
I've installed Python in the wrong directory. The mail program doesn't have
permission to access my $HOME directory, and I've installed Python2.0 in a
subdirectory of HOME. So, I need to uninstall it, and then reinstall it into a
directory that the mail program has access to.

What is the recommended uninstall procedure? I'm tempted to simply delete the
entire Python-2.0 folder, but don't want to get myself in trouble...

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/



Fri, 04 Jul 2003 13:33:42 GMT  
 Help with Python install


:I've been given a clue from the Sysadmin:
:I've installed Python in the wrong directory. The mail program doesn't have
:permission to access my $HOME directory, and I've installed Python2.0 in a
:subdirectory of HOME. So, I need to uninstall it, and then reinstall it into a
:directory that the mail program has access to.

Well, I have this problem solved, at least. Python 2.0 is installed, and my
script is functioning. I did have to put the full path in the .qmail file, as
suggested by Emile van Sebille. That, plus installing it in a directory where
the permissions allowed the mail program to access it, solved the problem.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/



Fri, 04 Jul 2003 15:20:11 GMT  
 Help with Python install
Sheila--thanks for posting the follow-up. I may be facing a similar
situation soon, and this could save me a lot of headaches. Too often we
never hear what the final resolution of a problem was.
Quote:
>K

> Well, I have this problem solved, at least. Python 2.0 is installed, and my
> script is functioning. I did have to put the full path in the .qmail file, as
> suggested by Emile van Sebille. That, plus installing it in a directory where
> the permissions allowed the mail program to access it, solved the problem.



Fri, 04 Jul 2003 20:29:06 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Python Install-Installed Python 2 on top of python 1.5

2. How to install python on clean RH7.1 install

3. Compiling/Installing Python 2.2.1 on AIX 4.3.3 Help

4. Help w/ Installing Python 1.5.2 on DG/UX failing

5. Help getting ISP to install Python

6. Need help installing Python 1.5 on Linux

7. A little script to help resolve dependencies on installed packages (RPM,Linux,Python)

8. running Python-Skripts without having Python installed

9. Running a Python program on a machine where Python isn't installed

10. clip 5.3 install on windows 95 HELP HELP

11. PEP 262: Database of Installed Python Packages

12. Curses test failure installing Python 2.2.2

 

 
Powered by phpBB® Forum Software