uwsgi + Flask + virtualenv ImportError: no module named site

前端 未结 8 698
感动是毒
感动是毒 2021-02-05 07:37

(Other posts on SO are similar, but none have the specific combination of uwsgi + Flask + virtualenv) (This one is closest)

I installed uwsgi via apt-get. I also tried

8条回答
  •  暖寄归人
    2021-02-05 07:47

    I had this problem when my homebrew updated my Python version to Python 3.7 and it stopped working. What worked for me was brew info python - that will show you all your available Python versions. Than I rolled back to Python 3.6.5 using brew switch python 3.6.5.

    After that I simply reinstalled my uWSGI using:

    pip3 uninstall uwsgi
    pip3 install uwsgi
    

    And that solved it. If you're not sure what version of Python you were using, brew info python shows you the install dates. Also, you can check using pip3 list if your uWSGI is installed for the current version.

    Hope this helps!

提交回复
热议问题