opensistemas-hub / osbrain

osBrain - A general-purpose multi-agent system module written in Python
https://osbrain.readthedocs.io/en/stable/
Apache License 2.0
175 stars 43 forks source link

question:locate the name server #314

Closed hivictoooooor closed 4 years ago

hivictoooooor commented 5 years ago

when i run the example osbrain/examples/hello_world.py

from osbrain import run_nameserver
from osbrain import run_agent

if __name__ == '__main__':

    # System deployment
    ns = run_nameserver()
    agent = run_agent('Example')

    # Log a message
    agent.log_info('Hello world!')

    ns.shutdown()

Errors :

File "..\osbrain\proxy.py", line 49, in locate_ns
    raise TimeoutError('Could not locate the name server!')
TimeoutError: Could not locate the name server!

why this?

ocaballeror commented 5 years ago

Weird.

Can you post the full traceback?

hivictoooooor commented 5 years ago

Weird.

Can you post the full traceback?

runfile('D:/code/connected-networks/temp.py', wdir='D:/code/connected-networks')
Traceback (most recent call last):

  File "<ipython-input-22-7b1707005eaa>", line 1, in <module>
    runfile('D:/code/connected-networks/temp.py', wdir='D:/code/connected-networks')

  File "D:\anaconda\envs\py35\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
    execfile(filename, namespace)

  File "D:\anaconda\envs\py35\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "D:/code/connected-networks/temp.py", line 16, in <module>
    ns = run_nameserver()

  File "D:\anaconda\envs\py35\lib\site-packages\osbrain\nameserver.py", line 233, in run_nameserver
    return NSProxy(addr)

  File "D:\anaconda\envs\py35\lib\site-packages\osbrain\proxy.py", line 328, in __init__
    locate_ns(nsaddr, timeout)

  File "D:\anaconda\envs\py35\lib\site-packages\osbrain\proxy.py", line 49, in locate_ns
    raise TimeoutError('Could not locate the name server!')

TimeoutError: Could not locate the name server!

That is all the traceback

Peque commented 5 years ago

@hivictoooooor Would you mind sharing with us your environment setup?

It is most probably an issue with your environment setup.

My recommendation for now, as a workaround, use Pipenv to run all your applications. :wink:

Probably related: https://github.com/opensistemas-hub/osbrain/issues/191

Peque commented 4 years ago

Closing as we did not receive required feedback.

Feel free to comment/reopen if you encounter this issue again. :blush: