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

File "api_server.py", line 2, in <module> from flask import Flask ImportError: No module named flask #51

Open
FasihZafar opened this issue Jan 7, 2019 · 2 comments

Comments

@FasihZafar
Copy link

No description provided.

@zomry1
Copy link

zomry1 commented Jan 13, 2020

You need to install the flask module.
In your command line (CMD) use the command:

"pip install flask"

@camkinney
Copy link

I am encountering the same issue, and haven't figured out how to get the api_server.py file to run.

I followed the steps here to set up the virtual machine. Then, as instructed in Lesson 2: Accessing Public APIs - Part 5: Sending API Requests, I tried to run the server, and I get the output below:

vagrant@vagrant:/vagrant$ python api_server.py
Traceback (most recent call last):
File "api_server.py", line 2, in
from flask import Flask
ImportError: No module named flask

When I try to install flask as suggested I get a further error.

vagrant@vagrant:/vagrant$ pip install flask
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in
from pip._internal.cli.main import main
File "/usr/local/lib/python2.7/dist-packages/pip/init.py", line 1, in
from typing import List, Optional

ImportError: No module named typing

I have tried various approaches such as this one from stack overflow to allow pip to install flask without success. Can someone help me determine what is going run, such that the VM doesn't work per instructions?

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

3 participants