uWSGI + virtualenv 'No module named site'

前端 未结 3 1195
一个人的身影
一个人的身影 2021-02-13 12:04

So this seems to be a really common problem with this setup, but I can\'t find any solutions that work on SO. I\'ve setup a very new Ubuntu 15.04 server, then installed nginx, v

3条回答
  •  时光取名叫无心
    2021-02-13 12:27

    As @Freek said, site refers to a python module.

    The error claims that python cannot find that package, which is because you have specified python_home to the wrong location.

    I've encountered with the same problem and my uwsgi.ini is like below:

    [uwsgi]
    # variable
    base = /home/xx/
    # project settings
    chdir = %(base)/
    module = botservice.uwsgi:application
    home = %(base)/env/bin
    

    For this configuration uwsgi can find python executable in /env/bin but no packages could be found under this folder. So I changed home to

    home = %(base)/env/
    

    and it worked for me.

    In your case, I suggest digging into home directive and point it to a location which contains both python executable and packages.

提交回复
热议问题