Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spade support for Python 3.8.1 #80

Open
siboxd opened this issue Feb 24, 2020 · 5 comments
Open

Spade support for Python 3.8.1 #80

siboxd opened this issue Feb 24, 2020 · 5 comments

Comments

@siboxd
Copy link
Contributor

siboxd commented Feb 24, 2020

  • SPADE version: 3.1.4
  • Python version: 3.8.1
  • Operating System: Windows 10, 64bit

Description

I'm a beginner with Spade and I was trying to follow the Quick start guide. In particular I was trying to make my first dummyagent.py work (where password is a .py file with variable my containing my correct password):

from spade import agent
import password

class DummyAgent(agent.Agent):
    async def setup(self):
        print("Hello World! I'm agent {}".format(str(self.jid)))

dummy = DummyAgent("sibo@dismail.de", password.my)
dummy.start()

dummy.stop()

So I installed the latest version of Python 3.8.1, created a virtual environment and installed Spade 3.4.1 through pipenv.

Then when I launched python dummyagent.py nothing happened. It seems that the process freezes and the agent won't start (no "Hello World" expected message will be printed.)

Launching that dummyagent.py should print the above mentioned message.

What I Did

I created a folder test in which i put the dummyagent.py and the password.py.

Cattura1

Cattura2

The last command will never write Hello World ...

@siboxd
Copy link
Contributor Author

siboxd commented Feb 24, 2020

I tried the same with Python 3.7.6, and it works.

Cattura

@javipalanca
Copy link
Owner

Hi
I've never tested SPADE with python >=3.8.
I'll try to test it and fix code ASAP.

@javipalanca
Copy link
Owner

However, having a start and a stop in a row may be too fast. Try introducing a sleep between them, or the common:

dummy.start()
while True:
    try:
        time.sleep(1)
    except KeyboardInterrupt:
        break
dummy.stop()

@siboxd
Copy link
Contributor Author

siboxd commented Feb 25, 2020

However, having a start and a stop in a row may be too fast. Try introducing a sleep between them, or the common:

dummy.start()
while True:
    try:
        time.sleep(1)
    except KeyboardInterrupt:
        break
dummy.stop()

Before opening this issue I also tried the second example present in "Quick Start Guide".

It seems to adopt the above mentioned pattern, but the example code still doesn't work with python 3.8.1, while (I've tried and) it works with python 3.7.6.

Cattura1

Cattura2

It won't go ahead from here.

@bdpythondocker
Copy link

hello guys, How can I broadcast messages using spade in a multi-agent system? can you please give me some sample code in python (SPADE)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants