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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jainarun
    New Member
    • Oct 2006
    • 6

    #1

    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>pyt hon subcontentitem. py d:\base\cnt1394 59a.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
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by jainarun
    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>pyt hon subcontentitem. py d:\base\cnt1394 59a.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

    Comment

    • jainarun
      New Member
      • Oct 2006
      • 6

      #3
      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

      Comment

      • bvdet
        Recognized Expert Specialist
        • Oct 2006
        • 2851

        #4
        Originally posted by jainarun
        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

        Comment

        Working...