SyntaxError: invalid syntax -- self.async = iscoroutinefunction(handler)
Attempting to run the example server code from the docs using Python 3.7.0b2 in pyenv on Mac OS 10.13.5. I haven't looked deep into the source yet but I am wondering if this is a known issue/incompatibility with Python 3.7.
✘ vibora_test ~/P/vibora_test python app.py Traceback (most recent call last): File "app.py", line 1, in <module> from vibora import Vibora, Request File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module> from .server import * File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/server.py", line 11, in <module> from .workers.handler import RequestHandler File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module> from ..hooks import Events File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/hooks.py", line 38 self.async = iscoroutinefunction(handler) ^ SyntaxError: invalid syntax
I was not aware of this issue, interesting... I'll push a fix tonight... I'll add Python 3.7 to the build pipeline so we can catch more of these... Thanks bro!
@frnkvieira No problem! If I wasn't at work I'd submit a PR myself :D
How do we solve this? I'm still experiencing it 😔
Oh the version at master works but the entry at PyPI isn't updated.
yes. this occurs on python 3.7.
yes . this is error on python 3.7
on my environment
- MacOS mojave version 10.14
- python3.7 (virtualenv)
- Vibora 0.0.6
Traceback (most recent call last):
File "app.py", line 1, in <module>
from vibora import Vibora, JsonResponse
File ".../lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module>
from .server import *
File ".../lib/python3.7/site-packages/vibora/server.py", line 11, in <module>
from .workers.handler import RequestHandler
File "../lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module>
from ..hooks import Events
File ".../lib/python3.7/site-packages/vibora/hooks.py", line 38
self.async = iscoroutinefunction(handler)
^
SyntaxError: invalid syntax
but I check latest of master branch (version 0.0.7) its work (manual install)
Any updates with this issue? Im still having this problem with Python 3.7
Traceback (most recent call last): File "index.py", line 1, in <module> from vibora import Vibora, JsonResponse File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module> from .server import * File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/server.py", line 11, in <module> from .workers.handler import RequestHandler File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module> from ..hooks import Events File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/hooks.py", line 38 self.async = iscoroutinefunction(handler) ^ SyntaxError: invalid syntax
The same problem...
https://docs.python.org/3/whatsnew/3.7.html => in 3.6, if you activate warning, it warn you about async and await being keyword also. In 3.7 async and await are not accepted as var name anymore. At this time vibora is not compatible with python 3.7
This bug is still existing Python 3.7 version. Anybody get a solution ? or need to downgrade Python version. thanks
This bug is also present in Python 3.8 solutions?
Ubuntu 18.04 Python 3.8.1 Pyenv 1.2.16 PipEnv 2018.11.26
pipenv update --python 3.8 pipenv install vibora[fast]
(async) fbenavides@x360:~/src/async$ python Python 3.8.1 (default, Feb 2 2020, 02:21:52) [GCC 9.2.1 20191008] on linux Type "help", "copyright", "credits" or "license" for more information.
import vibora Traceback (most recent call last): File "
", line 1, in File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/init.py", line 7, in from .server import * File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/server.py", line 11, in from .workers.handler import RequestHandler File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/workers/handler.py", line 7, in from ..hooks import Events File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/hooks.py", line 38 self.async = iscoroutinefunction(handler) ^ SyntaxError: invalid syntax
any update?
Any upd ?
This is fixed in the vibora code on Github, but it hasn't been pushed to PyPI. If you really want it to work, install Vibora directly via git instead of PyPI
?
In Ubuntu,
- sudo pip install cython3 (Install cython3)
- git clone https://github.com/vibora-io/vibora.git
- cd vibora
- nano build.py: change the line cython = os.path.join(os.path.dirname(sys.executable), 'cython') to cython = "cython"
- sudo python3 build.py
- sudo python3 setup.py install