问题
In fact I cannot use any pakage now!
importerror: no module named flask.ext.script
importerror: no module named Pymongo
回答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
回答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
来源:https://stackoverflow.com/questions/33675594/importerror-no-module-named-flask-ext-script