在Anaconda python库中使用Mod_wsgi [英] Using Mod_wsgi with Anaconda python library
问题描述
我已经安装了mod_wsgi --with-python选项。
当我在apache上运行flask应用程序时,它说No module name flask
Flask已经安装在anaconda中。
我如何强制mod_wsgi选择anaconda库
您可能需要执行以下操作。 / p>
从源代码构建mod_wsgi时,将 LD_RUN_PATH
环境变量设置为 / home / jdnco / anaconda2 / lib中
。因此,返回并在mod_wsgi源代码中执行以下操作:
make distclean
./configure --with -python = / home / jdnco / anaconda2 / bin / python
LD_RUN_PATH = / home / jdnco / anaconda2 / lib make
sudo make install
这将确保它与正确的库链接。再次检查 ldd
。
然后在Apache配置文件中也设置:
WSGIPythonHome / home / jdnco / anaconda2
在与系统目录中的版本相匹配的非标准位置使用Python安装时,这两者都是必需的。
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.
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.
这篇关于在Anaconda python库中使用Mod_wsgi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!