importerror: no module named flask.ext.script

10,513

Solution 1

It seems that you virtual environment doesn't work. You've installed the flask-script package, but when you run the script, it still looks for it in C:\Python3.4. You may give us more info so that we can figure it out where is wrong. (How do you install it, how do you active the virtualenv, does reinstall virtualenv work, close the cmd shell and try again works?)

Also note that from flask.ext.extension import xxx is the old way to use the flask extension. Instead you should use from flask_script import Manager, Server if you are using the latest flask-script 2.0.5

Solution 2

If you are using the IDE such as pycharm, then maybe need to set the interpreter of python for the right version. Otherwise the packages that you have installed can not be used for the current project. I have also encountered such kind of questions until I set my IDE's interpreter to the Python 2.7. Then you can freely import the flask_script

Share:
10,513
Mark White
Author by

Mark White

I love programming and helping other. My personal Website is

Updated on June 08, 2022

Comments

  • Mark White
    Mark White almost 2 years
  • user956424
    user956424 almost 8 years
    I have used it by both the import statements i.e 'from flask.ext.script import Manager' and 'from flask_script import Manager' with latest flask-script 2.0.5 both of them don't throw any exception, but get error while running cronjob