Flask - WSGI - No module named 'flask'

后端 未结 6 842
闹比i
闹比i 2021-02-01 23:50

I\'ve been following Sentdex\' Flask tutorial. He\'s using a Venv to set up his Flask, but didn\'t set his Python up to work with a Venv. I\'ve tried installing Flask globally -

6条回答
  •  悲哀的现实
    2021-02-02 00:27

    See the bottom of this page: https://flask.palletsprojects.com/en/1.1.x/deploying/mod_wsgi/#configuring-apache

    Were it says:

    For Python 3 add the following lines to the top of your .wsgi file:

    activate_this = '/path/to/env/bin/activate_this.py'
    with open(activate_this) as file_:
        exec(file_.read(), dict(__file__=activate_this))
    

    Where /path/to/env is the path to any virtual environment where you installed Flask, as described by others here on this thread. The "python-path" and some of the other VirtualHost configurations described here are unnecessary.

提交回复
热议问题