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 while running Flask in venv #211

Closed
rpalri opened this issue Nov 9, 2020 · 6 comments
Closed

SyntaxError: invalid syntax while running Flask in venv #211

rpalri opened this issue Nov 9, 2020 · 6 comments

Comments

@rpalri
Copy link

rpalri commented Nov 9, 2020

Why could this be happening? Please help!

Traceback (most recent call last):
  File "/opt/anaconda3/bin/flask", line 10, in <module>
    sys.exit(main())
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 967, in main
    cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 848, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 305, in __init__
    self._load_unlocked()
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 330, in _load_unlocked
    self._app = rv = self.loader()
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 392, in load_app
    app = locate_app(self, import_name, None, raise_if_not_found=False)
  File "/opt/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app
    __import__(module_name)
  File "/Users/raghav/Downloads/CS_Training/PS/plumber_app/app/app.py", line 1, in <module>
    import pandas as pd
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/__init__.py", line 30, in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
  File "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtable
  File "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missing
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/_libs/tslibs/__init__.py", line 30, in <module>
    from .conversion import OutOfBoundsTimedelta, localize_pydatetime
  File "pandas/_libs/tslibs/conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
  File "pandas/_libs/tslibs/timezones.pyx", line 7, in init pandas._libs.tslibs.timezones
  File "/opt/anaconda3/lib/python3.7/site-packages/dateutil/tz.py", line 78
    `self._name`,
@abhisuri97
Copy link
Contributor

Hi there, are you sure that this error message is from our library? there are some packages listed here that don't seem to be relevant to flask-base. If it is from this library, can you comment on what are the steps you took to actually get these errors?

@rpalri
Copy link
Author

rpalri commented Nov 15, 2020

I am simply trying to run the app using the command flask run and then getting this error.

@rpalri
Copy link
Author

rpalri commented Nov 15, 2020

I tried it without using the virtual environment and am still getting the same error.

@abhisuri97
Copy link
Contributor

Hmm. so could you try and run the application using the instructions in the README for this repository? (i.e. the "honcho" command). You'll also need to install the dependencies (ref the README instructions) in a virtual environment & activate that environment before you run the honcho command.

@rpalri
Copy link
Author

rpalri commented Nov 15, 2020

I'm pretty new at this. Let me try out what you said and then get back.

@abhisuri97
Copy link
Contributor

Closing (feel free to re-open if you need any more help!)

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

2 participants