ImportError: No module named svn

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajevar
    New Member
    • Aug 2009
    • 7

    ImportError: No module named svn

    well this is kind of strange.

    i have few scripts that run on a daily basis and it works good on one host . im my development env its failing on importError : no module svn

    I login as the user who is running the script and go to python prompt and try import svn. it wont throw any error. kind of strange.

    aamuser@dbdev01 :~>python
    Python 2.5.4 (r254:67916, May 26 2009, 12:58:10)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
    Type "help", "copyright" , "credits" or "license" for more information.
    >>>
    >>> import svn
    >>> svn
    <module 'svn' from '/local/mnt/qsrp/python/site-packages/svn/__init__.pyc'>


    i am scratching my head the last 2 days to figure out what is wrong and i have no clue. if i run the script manually it works good, but if it runs as part of the Makefile, its errors out saying svn module not found :(

    appreciate any comments on this.

    thanks,
  • kudos
    Recognized Expert New Member
    • Jul 2006
    • 127

    #2
    I think its called "pysvn", which is the svn module for python. Perhaps you rather want to run svn from python?

    -kudos

    Comment

    • Glenton
      Recognized Expert Contributor
      • Nov 2008
      • 391

      #3
      Do you have more than one version of python running on your machine?

      Comment

      • rajevar
        New Member
        • Aug 2009
        • 7

        #4
        thanks for the replies..

        well to be honest, im not a python developer but i have to support a project. so pardon me if my replies look dumb :)

        if i do "import svn" python prompt its showing no error and i was looking at code and it have more objects like svn.core . i believe what i need is svn not pysvn.

        how can i check if there are more than version of python running?

        - raj

        Comment

        • Glenton
          Recognized Expert Contributor
          • Nov 2008
          • 391

          #5
          I'd open the script in a normal text editor, and post the first few lines.

          Is this script also being run in linux? You might try to edit the first line from
          Code:
          #!/usr/bin/env python
          to
          Code:
          #!/usr/bin/env python2.5
          which will force it to run with python 2.5 instead of whatever python it's been set to which is normally the latest version.

          Comment

          • rajevar
            New Member
            • Aug 2009
            • 7

            #6
            i tried changing
            #!/usr/bin/env python to #!/usr/bin/env python2.5

            but ended up in same error :(

            Comment

            • Glenton
              Recognized Expert Contributor
              • Nov 2008
              • 391

              #7
              Can you try to describe more exactly what's happening, and maybe post the first lines of the code and the full error message? Also, your operating system.

              You mentioned that there's a regular user who is able to run the code. So possibly his environment variables are different from the other user. In this case the svn module might not be found because it's installed in a non-standard place.

              Comment

              • rajevar
                New Member
                • Aug 2009
                • 7

                #8
                got it fixed.. i was using cronjobs to run the build and there was path setting with in the cronjob, the path didnt look wrong but the issue got resolved after removing the path .. thank you all for your replies..

                - raj

                Comment

                Working...