How do I use a conda environment with mod_wsgi?

前端 未结 3 2138
长发绾君心
长发绾君心 2021-02-07 05:47

My first post, and I\'m new to both Python and Apache, so please go easy on me. I have a Python web application in a conda environment that serves up content just fine using Fl

3条回答
  •  梦谈多话
    2021-02-07 06:28

    Your mod_wsgi would need to be compiled against Anaconda Python to start with and not your system Python. In other words you cannot use the system supplied mod_wsgi packages but would need to compile it yourself. Then follow what it says in:

    • http://blog.dscpl.com.au/2014/09/using-python-virtual-environments-with.html

    That is, use daemon mode and use the python-home option to WSGIDaemonProcess.

    Do note that there have been reports suggesting that Anaconda Python is broken in some way and will not work with systems that want to embed Python. So may not work anyway.

    BTW, you cannot use '~' in the path in your WSGI script file anyway with the way you were doing it. It would not be expanded to be the home directory. But then, follow that post and you will not need that.

提交回复
热议问题