擅长:python、mysql、java
<p>下面是我如何解决在尝试<a href="https://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html" rel="nofollow noreferrer">Django and NGINX tutorial — uWSGI 2.0 documentation</a>时得到的相同错误消息<code>(ImportError: No module named site)</code>。</p>
<p>停用virtualenv:</p>
<pre><code>deactivate
</code></pre>
<p>在系统范围内安装uWSGI(如果尚未在系统范围内安装)</p>
<pre><code>sudo pip install uwsgi
</code></pre>
<p>编辑<code>uwsgi.ini</code>文件。我评论了这行:</p>
<pre><code>home = /path/to/virtualenv
</code></pre>
<p>运行<code>uWSGI --ini mysite_uwsgi.ini</code>。</p>