考虑将$ PYTHONHOME设置为<prefix> [:<exec_prefix>]

时间:2017-11-08 20:48:38

标签: python apache2 pythonpath

我正在尝试使用Apache2在VPS,Ubuntu-16.04上托管和应用myproject。我已经配置了apache2,但它显示了一个与python相关的奇怪错误。在apache2错误很长。这是我的000-default.conf文件内容。

<VirtualHost *:80>


    Alias /static /home/myproject/static
    <Directory /home/myproject/static>
        Require all granted
    </Directory>

    <Directory /home/myproject/myproject>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>



     WSGIDaemonProcess myproject python-home=/home/myproject/myprojectenv python-path=/home/myproject/myprojectenv/lib/python2.7/site-packages
     WSGIProcessGroup myproject
     WSGIScriptAlias / /home/myproject/myproject/wsgi.py

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

这是apache2错误日志的错误日志..

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

我还在“/ home / myproject / myvirtualenv”创建了一个virtualenv,我怎么能解决这个问题..

0 个答案:

没有答案