On Jun 21, 10:57 am, Yarin <ykess...@gmail.com> wrote:
> @mdipierro - Do you mean do I have multiple versions of Python on my
> system?
>
> $ ls usr/bin/ shows ->
> ...
> -rwxr-xr-x 1 root root         82 Jul 10  2008 pydoc
> -rwxr-xr-x 1 root root       3572 Jul 10  2008 python
> lrwxrwxrwx 1 root root         16 Nov 27  2009 python-config ->
> python2.5-config
> lrwxrwxrwx 1 root root          6 Nov 27  2009 python2 -> python
> -rwxr-xr-x 1 root root       3572 Jul 10  2008 python2.5
> -rwxr-xr-x 1 root root       1418 Jul 10  2008 python2.5-config
>
> but all of these refer to version Python2.5.1
>
> Moreover, I know that that error is thrown from web2py/gluon.tools.py
>    3285         try:
>    3286             import pyamf
>    3287             import pyamf.remoting.gateway
>    3288         except:
>    3289             return "pyamf not installed or not in Python
> sys.path"
>
> but when I run from the command line...
>
> $ python
>
> >>>> import pyamf
> >>>> import pyamf.remoting.gateway
>

Try to compare these two:

$ python -c 'import sys; print sys.path'

and, from your web2py directory:

$ python web2py.py -S welcome
>>> import sys;  print sys.path

Compare the two to see what's missing;

You can also find where your pyamf was installed -

If you are not seeing it somewhere like /usr/lib/python2.5/site-
packages (use your sys.path as a guide to the correct path), then it
is possible you made a local installation of pyamf --- if it appears
in somewhere in your $HOME directory, then that is likely your problem
- you installed it for yourself as a user, instead of site-wide.
Since apache does not run as you, your HOME install of pyamf is not in
the sys.path for web2py.

Hope this is helpful.  Let us know what you find.


> ...I get no errors
>
> I'm stumped- Is this a permissions issue?  What else can I test?
>
> My code:
>
> rpc.py:
>
> # coding: utf8
> # try something like
> def index(): return dict(message="hello from rpc.py")
>
> from gluon.tools import Service
> service = Service(globals())
>
> def call():
>     session.forget()
>     return service()
>
> @service.amfrpc3("mydomain")
> def test():
>     return "Test!!!"
>
> Flex client code: (Doubt it's helpful as this seems like a server, not
> client, issue)
>
> <mx:RemoteObject
>         id="amfService"
>         endpoint="http://{myPublicIP}/pyamf_test/rpc/call/amfrpc3";
>         destination="mydomain"
>         showBusyCursor="true">
>         <mx:method name="test"
>                 result="resultHandler(event)" fault="faultHandler(event)"
>                 />
> </mx:RemoteObject>
>
> And a side question:  What is the purpose of the domain field?  Can it
> be anything?

have no idea...

>
> @Kuba - How am I supposed to reboot web2py when it's running off of
> mod_wsgi?  I haven't figured that out yet- thought that since it was
> tied in with Apache an Apache restart would reboot web2py too.

Apache restart will do it;  depending on the mod_wsgi, there are
simpler restarts of the wsgi thread associated with your web2py that
do not require a restart of _all_ the sites your apache is running.
You probably don't care about that at this point (but if you do, read
up on mod_wsgi --- you touch a script to get the wsgi thread only to
restart, thus restarting web2py).

> However, I went so far as to reboot the whole system, so don't think
> that's the problem.

It's not.

- Yarko

>
> Thanks--
>
> On Jun 21, 2:26 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
>
>
> > On Jun 20, 8:50 pm, Yarin <ykess...@gmail.com> wrote:
>
> > > I set up web2py on a Fedora EC2 server, running with mod_wsgi and
> > > Apache.  Everything was working great with the initial setup.  I then
> > > tried to get amf working, by doing the following:
>
> > > $ easy_install pyamf
> > > $ apachectl restart
>
> > > However, when I try to connect with my Flex client, I get:
> > > "pyamf not installed or not in Python sys.path"
>
> > > When I run web2py from the command line and check sys.path, I see
> > > '/usr/lib/python2.5/site-packages/PyAMF-0.5.1-py2.5-linux-i686.egg'
>
> > > Is restarting Apache not enough?   Do RPC services even run through
> > > Apache? (excuse my ignorance)
>
> > It should. Is it possible you have different versions of Python?
>
> > > Thanks- Yarin

Reply via email to