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

SyntaxError: invalid syntax #62

Closed
spolezhaev opened this issue Apr 14, 2018 · 10 comments
Closed

SyntaxError: invalid syntax #62

spolezhaev opened this issue Apr 14, 2018 · 10 comments
Assignees

Comments

@spolezhaev
Copy link

After building from source all modules and just importing the following line:
from botbuilder.core import BotFrameworkAdapter
I get
image
Windows 10, x64, the same on Linux (CentOS)

@stevengum
Copy link
Member

@Piteryo, and @bruce-willis are you using Python 3 or Python 2?

@bruce-willis
Copy link

@stevengum97 python 3

@stevengum
Copy link
Member

stevengum commented Apr 16, 2018

What's the entire semver, is it at least 3.5? typing was introduced in 3.5.

@spolezhaev
Copy link
Author

@stevengum97, yeah, I have Python 3.5.2

@stevengum
Copy link
Member

Sorry about that, this syntax only became valid in 3.6. Can you upgrade to a Python version greater than 3.6? We're targeting 3.6 and greater.

    classifiers=[
        'Programming Language :: Python :: 3.6',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Development Status :: 3 - Alpha',
        'Topic :: Scientific/Engineering :: Artificial Intelligence',
    ]

@bruce-willis
Copy link

bruce-willis commented Apr 16, 2018

@stevengum97 managed to run using python 3.6.4. However, I had some problems with sample in the wiki, but sample in sample directory works well.

Exception text:

Exception happened during processing of request from ('127.0.0.1', 20773)
Traceback (most recent call last):
File "C:\Anaconda3\lib\socketserver.py", line 317, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Anaconda3\lib\socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "C:\Anaconda3\lib\socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Anaconda3\lib\socketserver.py", line 696, in init
self.handle()
File "C:\Anaconda3\lib\http\server.py", line 418, in handle
self.handle_one_request()
File "C:\Anaconda3\lib\http\server.py", line 406, in handle_one_request
method()
File ".\main.py", line 58, in do_POST
self._adapter = BotFrameworkAdapter(APP_ID, APP_PASSWORD)
TypeError: __init__() takes 2 positional arguments but 3 were given.

If it matter - I left APP_ID and APP_PASSWORD blank and tried to connect both on http://localhost:9000/api/messages and http://localhost:9000

@stevengum
Copy link
Member

@bruce-willis, I'm looking at the wiki sample now and it looks like it is in need of some revisions. For starters, as indicated by that TypeError, the BotFrameworkAdapter actually takes just one parameter from the user; an instantiated BotFrameworkAdapterSettings. When you ping the bot it should respond on http://localhost:9000, not http://localhost:9000/api/messages

@stevengum stevengum self-assigned this Apr 16, 2018
@bruce-willis
Copy link

@stevengum97, yeah. it's really seems like that the wiki simple needs to be updated. And his description too 😄:

In your local terminal you should see the message 'Started http server on localhost:9000'
Start the Bot Framework Emulator, connect to your bot by using http://localhost:9000/api/messages.

image

BTW: the bot from sample directory responds both on http://localhost:9000/api/messages and http://localhost:9000

@stevengum
Copy link
Member

Then it probably responds to POST requests from any route, which is a little amusing in itself. 😃

I'm going to leave this issue open for now until we get the wiki updated, if you run into any unrelated issues, please feel free to open up a new issue.

@vishwacsena vishwacsena added this to the BUILD 2018 milestone Apr 17, 2018
@stevengum
Copy link
Member

I've updated the wiki, so I'm going to close the issue.

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

4 participants