vibora icon indicating copy to clipboard operation
vibora copied to clipboard

Error running sample app from Vibora homepage

Open danechitoaie opened this issue 6 years ago • 7 comments

Hi,

When I try to run the sample app from https://vibora.io/ I get

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from vibora import Vibora, Response
  File "/Users/daniels/.local/share/virtualenvs/dnls-VYZ3-Qd3/lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module>
    from .server import *
  File "/Users/daniels/.local/share/virtualenvs/dnls-VYZ3-Qd3/lib/python3.7/site-packages/vibora/server.py", line 11, in <module>
    from .workers.handler import RequestHandler
  File "/Users/daniels/.local/share/virtualenvs/dnls-VYZ3-Qd3/lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module>
    from ..hooks import Events
  File "/Users/daniels/.local/share/virtualenvs/dnls-VYZ3-Qd3/lib/python3.7/site-packages/vibora/hooks.py", line 38
    self.async = iscoroutinefunction(handler)
             ^
SyntaxError: invalid syntax

python --version
Python 3.7.0

danechitoaie avatar Jul 31 '18 11:07 danechitoaie

Same problem with me when I use Python 3.7.0 , but works fine with Python 3.6.5.

ryrebs avatar Jul 31 '18 12:07 ryrebs

I guess async is a reserved keyword (I mean it is, I'm just referring to the fact that now you can't use it as a self.variable anymore). If I open that file in Visual Studio Code it's even highlighted differently vs the other self.something assignments.

danechitoaie avatar Jul 31 '18 12:07 danechitoaie

Yes, you're right. According to Python 3.7.0 docs:

Backwards incompatible syntax changes: async and await are now reserved keywords.

ryrebs avatar Jul 31 '18 12:07 ryrebs

Duplicate of https://github.com/vibora-io/vibora/issues/16

It's already fixed, pull from master

davidtgq avatar Aug 01 '18 20:08 davidtgq

pip install git+https://github.com/vibora-io/vibora.git@master works up until this point:

creating build/temp.macosx-10.13-x86_64-3.7/vendor/http-parser-2.8.1
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I. -I/git/vibora/vibora -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c vibora/parsers/parser.c -o build/temp.macosx-10.13-x86_64-3.7/vibora/parsers/parser.o -O3
clang: error: no such file or directory: 'vibora/parsers/parser.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
    
Command "/Users/joel/.virtualenvs/py3env/bin/python3.7 -u -c "import setuptools, tokenize;
__file__='/private/var/folders/7x/508pl7d93fx3nfdwmkggnjyr0000gn/T/pip-req-build-evk1x3d4/setup.py';
f=getattr(tokenize, 'open', open)(__file__);
code=f.read().replace('\r\n', '\n');
f.close();
exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/7x/508pl7d93fx3nfdwmkggnjyr0000gn/T/pip-record-mc5u9269/install-record.txt --single-version-externally-managed --compile --install-headers /Users/joel/.virtualenvs/py3env/bin/../include/site/python3.7/vibora" failed with error code 1 in /private/var/folders/7x/508pl7d93fx3nfdwmkggnjyr0000gn/T/pip-req-build-evk1x3d4/

joelclipperton avatar Aug 03 '18 05:08 joelclipperton

Same problem here about missing vibora/parsers/parser.c. Any idea when the pip package will be fixed ?

Best regards, Edouard

Madko avatar Aug 16 '18 08:08 Madko

So I specified using pip3 instead of pip and install worked.

joelclipperton avatar Aug 17 '18 20:08 joelclipperton