Announcement Announcement Module
Collapse
No announcement yet.
Trouble using pyro4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trouble using pyro4

    Hi, I am a total newbie to spring python so I appreciate any help you can give me.
    I am getting an error that says No module named Pyro.core from springpython

    File "C:\Python26\lib\site-packages\springpython-1.3.0.rc1-py2.6.egg\springpython\factory\__init__.py", line 37, in create_object
    __import__(module_name)
    File "C:\Python26\lib\site-packages\springpython-1.3.0.rc1-py2.6.egg\springpython\remoting\pyro\__init__.py", line 17, in <module>
    import Pyro.core
    ImportError: No module named Pyro.core

    not sure why this is happening?
    Thanks.
    I am basically running the sample code on
    http://static.springsource.org/sprin.../remoting.html
    Last edited by js1234556; Feb 17th, 2012, 01:37 PM. Reason: added a link

  • #2
    Have you installed Pyro yet? There is Pyro and Pyro4, which are two different versions (the previous being Pyro 3). If you are using virtualenv, then you have access to pip, and can type "pip install Pyro". Or, "pip install Pyro4" and use Pyro4ServiceExporter and Pyro4ProxyFactory.

    For more details about Pyro itself, see http://irmen.home.xs4all.nl/pyro/ and http://irmen.home.xs4all.nl/pyro3/.

    Comment


    • #3
      Greg, thank you for you response.
      I have installed Pyro4 and I am able to use it directly and run code that accesses remote objects.

      I am having trouble getting springpython to call Pyro4. see code below. I also tried changing to
      class="springpython.remoting.Pyro4.Pyro4ServiceExp orter" with the same import problems.

      I am using the following code to try and create a remote service:
      (serverl.xml)
      <?xml version="1.0" encoding="UTF-8"?>
      <objects xmlns="http://www.springframework.org/springpython/schema/objects/1.1"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/springpython/schema/objects/1.1
      http://springpython.webfactional.com/schema/context/spring-python-context-1.1.xsd">

      <object id="remoteService" class="server.Service"/>

      <object id="service_exporter" class="springpython.remoting.pyro.PyroServiceExpor ter">
      <property name="service_name" value="ServiceName"/>
      <property name="service" ref="remoteService"/>
      <property name="service_host" value="127.0.0.1"/>
      <property name="service_port" value="7000"/>
      </object>

      </objects>

      And in the following code in (server.py):

      from springpython.config import XMLConfig
      from springpython.context import ApplicationContext

      class Service(object):
      def get_data(self, param):
      return "You got remote data => %s" % param

      if __name__ == "__main__":
      appContext = ApplicationContext(XMLConfig("server.xml"))

      Comment

      Working...
      X