flask icon indicating copy to clipboard operation
flask copied to clipboard

Missing import on Flask 0.11.1

Open wschmrdrNS opened this issue 10 years ago • 7 comments

Traceback found (redacted for relevancy to Flask):
  File "/usr/local/lib/python2.7/dist-packages/flask/__init__.py", line 21, in <module>
    from .app import Flask, Request, Response
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 27, in <module>
    from . import json, cli
  File "/usr/local/lib/python2.7/dist-packages/flask/cli.py", line 17, in <module>
    import click
ImportError: No module named click

Just recently upgraded from 0.10 to 0.11. Did not see a requirements.txt for 3rd party dependencies.

wschmrdrNS avatar Jun 08 '16 16:06 wschmrdrNS

https://github.com/pallets/flask/blob/master/setup.py#L77

Sounds like whoever packaged flask for your distro screwed something up.

FYI, you shouldn't install Flask through your distro's package manager but using pip inside a virtualenv.

ThiefMaster avatar Jun 08 '16 16:06 ThiefMaster

OK. Please be aware that going from 0.10.1 to 0.11.1 did not install click for me; I had to upgrade to 0.11 and THEN to 0.11.1 for it to work.

wschmrdrNS avatar Jun 08 '16 16:06 wschmrdrNS

@wschmrdrNS How did you install Flask?

untitaker avatar Jun 08 '16 17:06 untitaker

sudo pip install --upgrade -r requirements.txt

Inside of requirements.txt for my project, I have: Flask==0.11.1

wschmrdrNS avatar Jun 08 '16 17:06 wschmrdrNS

I can't reproduce your issue. I created a Python 2.7 env, added Flask==0.10.1 in requirements.txt, pip install -r requriements.txt, modified to ==0.11.1, pip install -U -r requirements.txt. Flask was upgraded and Click was installed.

Unrelated, but never sudo pip install. Install in a virtualenv.

davidism avatar Jun 08 '16 17:06 davidism

Why?

untitaker avatar Dec 12 '16 17:12 untitaker

Sorry @untitaker, it happened to me as I use --no-deps in production environment. Solved here.

jonathansp avatar Dec 12 '16 18:12 jonathansp