469,271 Members | 1,787 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Execution Error (importing packages, setting sys.path) [solved]

Hi,

When i am trying to execute python module as shown below it it running sucessfully on some machine but on others m/c it is showing following error msg:

C:\Python24>python subcontentitem.py d:\base\cnt139459a.xml
Traceback (most recent call last):
File "subcontentitem.py", line 1, in ?
import sys, os, re, random, Ft.Xml.Domlette
ImportError: No module named Ft.Xml.Domlette

Please do the needful ASAP.

Thanks and Regards,
Arun Jain
Oct 24 '06 #1
3 2789
bartonc
6,596 Expert 4TB
Hi,

When i am trying to execute python module as shown below it it running sucessfully on some machine but on others m/c it is showing following error msg:

C:\Python24>python subcontentitem.py d:\base\cnt139459a.xml
Traceback (most recent call last):
File "subcontentitem.py", line 1, in ?
import sys, os, re, random, Ft.Xml.Domlette
ImportError: No module named Ft.Xml.Domlette

Please do the needful ASAP.

Thanks and Regards,
Arun Jain
On a machine which succeeds at running type
import sys
print sys.path
in the python command line.

In one of the directories in that list there is probably a directory tree
"Ft/Xml/" with the Domlette file in it.

If this tree exists on the machines on which running fails, you can move it to match the other installations or add the path to the Ft directory to sys.path in one of several way:
1. sys.path.append(r"absolute/file/path")
2. edit $PYTHONPATH environment variable to include the path
3. create a textfile (say ftpath).pth with the path in it and store it somewhere where python looks by default (say) sitepackages
Oct 24 '06 #2
Hi Bartonc ,

Thanks for ur quick reply.But i don't know Python language.I have to only parse the python file which is sent by client.I am not understanding what do u want to say? can u tell me in simple language what i have to do to resolve this problem.

Your quick reply will be highly appriciated.

Thanks and Regards,
Arun
Oct 25 '06 #3
bvdet
2,851 Expert Mod 2GB
Hi Bartonc ,

Thanks for ur quick reply.But i don't know Python language.I have to only parse the python file which is sent by client.I am not understanding what do u want to say? can u tell me in simple language what i have to do to resolve this problem.

Your quick reply will be highly appriciated.

Thanks and Regards,
Arun
On the machine that fails to execute, make sure folders Ft\Xml\ exist on the system path and that the file 'Domlette.py?' exists in that directory. A file named __init__.py must also exist in that directory.

HTH,
BV
Oct 25 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Active8 | last post: by
3 posts views Thread by Olivier Noblanc ATOUSOFT | last post: by
10 posts views Thread by greenb | last post: by
2 posts views Thread by avenpace | last post: by
reply views Thread by Martin P. Hellwig | last post: by
5 posts views Thread by sawilla | last post: by
2 posts views Thread by Aaron Scott | last post: by
reply views Thread by Fredrik Lundh | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.