简体   繁体   English

pip install mod_wsgi,如何设置 MOD_WSGI_APACHE_ROOTDIR 环境?

[英]pip install mod_wsgi, How to Set MOD_WSGI_APACHE_ROOTDIR environment?

I am trying to install mod_wsgi in Windows 10.我正在尝试在 Windows 10 中安装 mod_wsgi。

The command pip install mod_wsgi is giving me error,命令pip install mod_wsgi给了我错误,

RuntimeError: No Apache installation can be found. Set the MOD_WSGI_APACHE_ROOTDIR environment to its location.

My Apache dir is F:\Apache24\ .我的 Apache 目录是F:\Apache24\

My question is, how to setup MOD_WSGI_APACHE_ROOTDIR environment ?我的问题是,如何设置 MOD_WSGI_APACHE_ROOTDIR 环境?

Thanks, Sambhav谢谢, 桑巴夫

Referring to the docs at http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.12.html should help you.参考http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.12.html上的文档应该会对您有所帮助。

In Short:简而言之:

By default the installation looks for Apache in C:\Apache24 , C:\Apache22 and C:\Apache2 , as your installation is none of these you need to set the environment variable MOD_WSGI_APACHE_ROOTDIR to the path you have installed it to.默认情况下,安装会在C:\Apache24C:\Apache22C:\Apache2中查找 Apache,因为您的安装不是这些,您需要将环境变量MOD_WSGI_APACHE_ROOTDIR设置为您安装它的路径。

On your system you would do this by running this in your command prompt:在您的系统上,您可以通过在命令提示符下运行它来执行此操作:

set "MOD_WSGI_APACHE_ROOTDIR=F:\Apache24"

Which sets the variable, and then you can run the pip command (in the same command prompt):设置变量,然后您可以运行 pip 命令(在同一命令提示符下):

pip install mod_wsgi


To read more about the set command run set /?要阅读有关set命令的更多信息,请运行set /? in command prompt.在命令提示符下。

If pip install mod_wsgi cannot find the apache root dir and asked to set ( MOD_WSGI_APACHE_ROOTDIR ) env variable.如果pip install mod_wsgi找不到 apache 根目录并要求设置( MOD_WSGI_APACHE_ROOTDIR )环境变量。

set "MOD_WSGI_APACHE_ROOTDIR=F:\Apache24"

does not work in pycharm terminal (powershell), use below instead (verify path)在 pycharm 终端(powershell)中不起作用,请改用下面(验证路径)

$env:MOD_WSGI_APACHE_ROOTDIR = "C:\wamp64\bin\apache\apache2.4.51"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM