python script error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting python script error
# 1  
Old 08-24-2011
python script error

Hi

I have written a script in python and used it inside Ubuntu and its worked for me.

The script import email.utils, however in centos when I try to run the script I get:
Code:
Traceback (most recent call last):
    File "./warning.py", line 4, in ?
      import email.utils
  ImportError: No module named utils

In what can I replace the module utils in order to make it work for centos ass well.
# 2  
Old 08-24-2011
It's supposed to be a standard module... do you have a file named email.py lurking around perchance? it may be importing the wrong thing by accident.
# 3  
Old 08-24-2011
Quote:
Originally Posted by Corona688
It's supposed to be a standard module... do you have a file named email.py lurking around perchance? it may be importing the wrong thing by accident.
It is not the computer I work on.

Anyway I notice it is common problem for centos.
In all of them it say that it doesn't find the module utils in email.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

How to execute python script on remote with python way..?

Hi all, I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine.. Below is the code I am trying: #!/usr/bin/env python import wmi c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies

2. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

3. Programming

Tuple Error in Python

Hi, I am getting the below error: AttributeError: 'tuple' object has no attribute 'field_id' This line is complaining on the below code snippet: field_list = for f in source_rows: field_list.append(f.field_id) Where source_rows returns multiple rows of... (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

4. Shell Programming and Scripting

Python Name Error

Hi There, I have the following code: import time import paramiko node_list = for node in node_list: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(node, username='lord', password='xxxx') variables = {} stdin,... (3 Replies)
Discussion started by: infinitydon
3 Replies

5. Shell Programming and Scripting

python - string encoding error

I'm trying to pull a google calendar (successful) and then put the contents into a mysql db (almost successful). On one of the field I keep getting an encode error: #!/usr/bin/python from xml.etree import ElementTree import gdata.calendar.data import gdata.calendar.client import... (12 Replies)
Discussion started by: unclecameron
12 Replies

6. Programming

Python MySQL error

Hey all, I'm trying to enter some data into a database and I keep getting this error: Traceback (most recent call last): File "./ais_file_parser.py", line 77, in <module> cursor.execute(sql) File "/usr/lib/pymodules/python2.7/MySQLdb/cursors.py", line 166, in execute ... (1 Reply)
Discussion started by: pmd006
1 Replies

7. Shell Programming and Scripting

Passing variable from shell script to python script

I have a shell script main.sh which inturn call the python script ofdm.py, I want to pass two variables from shell script to python script for its execution. How do i achieve this ????? Eg: main.sh a=3 b=3; c= a+b exec python ofdm.py ofdm.py d=c+a Thanks in Anticipation (4 Replies)
Discussion started by: shashi792
4 Replies

8. Programming

Error in Python Embeded in Qt C++

hi i have an error in script language when run it i use python 2.4, CentOS 5.5, Qt C++ 2010/04 the error is SystemError: null argument to internal routine the Python Code def main(i): print i if __name__ == "__main__": main(i) the C++ Code PyObject *objModule =... (0 Replies)
Discussion started by: HanyM.Magdy
0 Replies

9. Shell Programming and Scripting

Hi Python and shell script,the script hangs

Hi I need to run a shell script from a TCL script,the shell script in trun will run a python script 1.Tcl script set filename "./GopiRun.sh" 2.GopiRun.sh python ./psi.py $MYSB/test_scripts/delivery/gpy1.py 3.I have my gpy1.py script. Here the problem i am facing is on running... (0 Replies)
Discussion started by: nathgopi214
0 Replies

10. Shell Programming and Scripting

How to run python script from a Tcl script

Hi I have a python script,i need to run this script from a tcl script.Can anyone let me know how to do this (1 Reply)
Discussion started by: nathgopi214
1 Replies
Login or Register to Ask a Question