In fact I cannot use any pakage now!
-
is your Path properly set ? – Busturdust Nov 12 '15 at 15:56
-
Is `py` the same interpreter that `pip` is linked to? When in doubt, `python -m pip install` is the best way to install packages (in this case use `py -m`). – dirn Nov 12 '15 at 16:34
4 Answers
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

- 4,500
- 2
- 22
- 30
-
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 – user956424 Aug 03 '16 at 08:14
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

- 157
- 1
- 3
I think you should use python 2
to use this module flask.ext.script
" because this is the old way of doing it, or you could install Flask-Script
and import it this way from flask_script
import ...

- 1,954
- 5
- 27
- 40

- 31
- 1
- 1
from flask.ext.extension import xxx is the old way of importing extensions ,now it's not working .You have to freeze first to outputs the package and its version installed in the current environment . Then you can check your module and import it as usual
e.g: -from flask_bcrypt import Bcrypt #this import the Bcrypt from flask_bcrypt

- 11
- 4