Announcement Announcement Module
Collapse
No announcement yet.
Is there a spring python jar type file as there is a spring.jar for the java version? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a spring python jar type file as there is a spring.jar for the java version?

    Hi,

    I am new using spring python and python, but I've used spring java for many years. In spring java we have a jar file that we add into our lib directory and we are all set ready to go.

    Is there any jar file type for spring python that I could do just the same? or how do you guys import it into your application? just making sure that the spring python directory is in the python path? how do you handle deployments?

    Please let me know. I really appreciate your help.
    Thank you very much in advance.

  • #2
    Installing Spring Python

    Originally posted by seth1 View Post
    Hi,

    I am new using spring python and python, but I've used spring java for many years. In spring java we have a jar file that we add into our lib directory and we are all set ready to go.

    Is there any jar file type for spring python that I could do just the same? or how do you guys import it into your application? just making sure that the spring python directory is in the python path? how do you handle deployments?

    Please let me know. I really appreciate your help.
    Thank you very much in advance.
    a) If you have grabbed the source, make sure that trunk/src/springpython is on your PYTHONPATH.

    b) If you downloaded the tar ball, then unpack it and move to the directory containing setup.py.
    Code:
    python setup.py install
    or
    Code:
    jython setup.py install
    After completing (a) or (b), then you should be able to launch python/jython, and import the libraries that you need. Be advised, if using (a), you may have to configure PYTHONPATH either in .bashrc/.cshrc, or manually everytime you launch a new shell. I recommend (b) to avoid all that.

    NOTE: None of these steps install Pyro, PyYAML or CherryPy. Visit the hyperlinks to grab a copy of those, and execute the same type of "python setup.py install" steps to install them.

    Got more questions? Please feel free to post them here. I can't promise same day answers, but we are striving to make this stuff accessible and usable. Have an issue? File a jira ticket so we can work on it.

    Comment


    • #3
      Thank you very much gregturn for your email. Have you ever tried to do this on windows? I've had no problems setting it on OS X 10.5, but on windows does not seem to work, even setting up the PYTHONPATH. Maybe I am missing some steps for windows? (I am using Vista).

      Comment


      • #4
        Unfortunately, no I haven't done this on Windows. My development at home is on ubuntu linux. With Mac OS X based on BSD, I can appreciate how the linux solution translates nicely to that platform.

        However, Dariusz (who monitors the email list) has done work with Spring Python on Windows (he wrote SQLServerConnectionFactory). If you re-post your issue on the email list, he might be able to give you a better answer.

        I definitely want to see this working on as many platforms as possible, so we can better support the community.

        Comment


        • #5
          Originally posted by seth1 View Post
          Have you ever tried to do this on windows? I've had no problems setting it on OS X 10.5, but on windows does not seem to work, even setting up the PYTHONPATH. Maybe I am missing some steps for windows? (I am using Vista).
          Hi,

          sorry it took me so long, here are the steps to install Spring Python on Windows. Note that Spring Python uses standard Python's distutils commands
          so there's actually nothing Windows-specific to it. I'm using Windows Server 2003 but I think it should be irrelevant.

          First, I downloaded springpython-1.0.0.RELEASE.tar.gz from here
          http://www.springsource.com/download/community

          Extracted it to a temporary location and issued a standard "python setup.py install" command which resulted in a spur of messages with a final one saying where Spring Python had been installed to:

          Code:
          c:\tmp\springpython-1.0.0.RELEASE>C:\Python25\python.exe setup.py install
          running install
          running build
          running build_py
          creating build
          creating build\lib
          creating build\lib\springpython
          
          [...]
          
          running install_egg_info
          Writing
          C:\Python25\Lib\site-packages\springpython-1.0.0.RELEASE-py2.5.egg-info
          
          c:\tmp\springpython-1.0.0.RELEASE>
          Then I changed the directory to C:\Python25\ and fired up the Python interpreter

          Code:
          c:\tmp\springpython-1.0.0.RELEASE>cd C:\Python25\
          c:\Python25>python
          then I imported the 'springpython' package and checked where it's been imported from - c:\Python25\lib\site-packages\springpython.

          Code:
          Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
          (Intel)] on win32
          Type "help", "copyright", "credits" or "license" for more information.
          >>> import springpython
          >>> springpython
          <module 'springpython' from 'c:\Python25\lib\site-packages\springpython\__init__.py'>
          >>>
          Can you please, repeat the same steps on your system and tell me where it differs?

          By the way, here's the info regarding the mailing list - http://springpython.webfactional.com/node/12

          cheers,

          Comment


          • #6
            Thank you very much dsuch. I really appreciate your help.

            Looks like I was missing the 4Suite-XML-1.0.2.win32-py2.5 as spring-python makes reference to it. In OS X 10.5 amara installed the 4Suite and I did not have to do anything, but the windows version of amara does not install 4Suite and I had to do it my self.

            On windows, I am able to import spring python through the command line.

            But, on eclipse (on windows), pydev is unable to recognize spring python. Notice that eclipse on Os X 10.5 does not have this problem.

            I am using python 2.5, pydev 1.5 and eclipse 3.5 on both windows vista on Os X 10.5 any clues what could be wrong?

            I will appreciate any comments. Thank you very much again.

            Comment


            • #7
              I fixed my own problem:
              I needed to add manually Python25\Lib\site-packages\springpython and all the dependencies on Eclipse->Window->Preferences->Pydev->Interpreter->Libraries->Apply and then Remove and Add the Python interpreter again.
              This does not make too much sense to me...but that fixed the problem. And as I said before, I did not need to do anything on eclipse pydev on Os X 10.5
              Hope it helps.

              Comment


              • #8
                Glad you got it working.

                This sounds like a Pydev problem to me. Pydev should be deferring to python for package locations, and python usually recognizes anything in the site-packages folder.

                Since almost all my current Spring Python work is done through a terminal and using vi, I haven't been on top of Pydev and SP.

                Comment

                Working...
                X