Error: Failed to find anything that looks like a service in module

155 views
Skip to first unread message

Lin Wang, PHD

unread,
Nov 14, 2016, 3:00:14 PM11/14/16
to nameko-dev
I tried the following example both in Linux and Mac OS. Got the error as list in Title.
# helloworld.py

from nameko.rpc import rpc

class GreetingService:
    name = "greeting_service"

    @rpc
    def hello(self, name):
        return "Hello, {}!".format(name)
What I did just:
$ virtualenv service_env
$ source service_env/bin/activate
(service_env)$ pip install nameko
(service_env)$ nameko run helloworld

Lin Wang, PHD

unread,
Nov 14, 2016, 8:34:03 PM11/14/16
to nameko-dev
add object solve the problem:
class HelloWorldService(object):

Matt Yule-Bennett

unread,
Nov 15, 2016, 4:56:11 AM11/15/16
to nameko-dev
Ahh. This is because the examples assume Python 3. 

David Szotten

unread,
Nov 15, 2016, 5:03:38 AM11/15/16
to nameko-dev
This is making me reconsider that decision

Maybe we should keep py3 on the snippet but make examples py2 compatible? (including future unicode_literals)

Fergus Doyle

unread,
Nov 15, 2016, 5:40:54 AM11/15/16
to David Szotten, nameko-dev
+1 for either backwards compatible examples or explicitly calling out where examples expect a python 3 environment

--
You received this message because you are subscribed to the Google Groups "nameko-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nameko-dev+unsubscribe@googlegroups.com.
To post to this group, send email to namek...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/nameko-dev/e264b574-596e-4260-895f-e508705fe5e3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Matt Bennett

unread,
Nov 15, 2016, 6:16:17 AM11/15/16
to Fergus Doyle, David Szotten, nameko-dev
Pull requests welcome Fergus ;)

You might just have to revert some of this: https://github.com/nameko/nameko/pull/350/files

I dislike the idea of importing unicode literals if we can avoid it -- scattering a few "u"'s around is my preference.

Reply all
Reply to author
Forward
0 new messages