LAB on Python question 06 'Change port in to 5000 and start the app'

Hi Folks,

I changed the port number to 5000 and start to execute the python but the result is not expected. It is throwing an error as below

Error after executing the below commands
thor@host01 /opt/simple-webapp-flask$ sudo python
Traceback (most recent call last):
File “”, line 2, in
from flask import Flask
ImportError: No module named flask

I checked the environment path for current requirement are installed by using below commandoes
import sys
print sys.path ( in the before “from flask import Flask” )

but packages are installing to 2.7 python.

I tried to change the path environment variable when i’m appending (sys.path.append("/usr/lib64/python3.6/site-packages") but not working.

and tried to install the pip3 for the requirements.

can you please help me to override the issues .For more please find the below attached screen shots.



Govardhan N

@Govardhan, could you please try this sudo pip3 install flask


As per your suggestion. I gave above command as sudo pip3 install flask but did not worked. can you please suggest me.

Hi All,

I figured out the problem it is locating the path to python2.7 but when i’m setting up to 3.6 version it is not able to set the or append and I tried use the following command as sys.path.append("/usr/lib64/python3.6/site-packages"). But did not worked. I am looking for you can help me with setting up the environment or sys path for python3.6. Because I got know that flask or other module are not support for python2.7.

Govardhan N

Follow this steps

  1. sudo sed -i ‘s/8080/5000/g’
  2. sudo pip3 install flask
  3. python3

Please let me know issue persists.

1 Like

the above commands it worked