Using Mod_wsgi with Anaconda python library

此生再无相见时 提交于 2019-12-11 06:49:37

问题


I have install mod_wsgi --with-python option. When i am running flask app on apache it is saying "No module name flask" Flask is already installed in anaconda. How can i force mod_wsgi to pick up the anaconda libraries.


回答1:


You probably need to do the following.

When you are building mod_wsgi from source code, set the LD_RUN_PATH environment variable to /home/jdnco/anaconda2/lib. Thus go back and do something like the following in mod_wsgi source code:

make distclean
./configure --with-python=/home/jdnco/anaconda2/bin/python
LD_RUN_PATH=/home/jdnco/anaconda2/lib make
sudo make install

This will ensure it is linking with the correct library. Check with ldd again.

Then in the Apache configuration file also set:

WSGIPythonHome /home/jdnco/anaconda2

Both of these is necessary when using a Python installation in a non standard location which matches version in system directories.



来源:https://stackoverflow.com/questions/40151469/using-mod-wsgi-with-anaconda-python-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!