title: django, pyenv, uwsgi - ModuleNotFoundError: No module named 'django'
body: <p>I have the following vassal configuration in <code>/etc/uwsgi/vassals/gsd.ini</code>:</p>
  
  <pre><code>[uwsgi]
  plugins = python
  env = DJANGO_SETTINGS_MODULE=%n.settings
  virtualenv = /home/toogy/.pyenv/versions/%n
  chdir = /home/webapps/%n
  module = %n.wsgi:application
  master = true
  vacuum = true
  pidfile = /tmp/uwsgi-%n.pid
  socket = /tmp/uwsgi-%n.sock
  daemonize = /var/log/uwsgi/%n.log
  chmod-socket = 666
  uid = toogy
  gid = toogy
  </code></pre>
  
  <p>Here is the uwsgi log I get</p>
  
  <pre><code>Tue Feb  7 10:49:12 2017 - received message 1 from emperor
  ...gracefully killing workers...
  Gracefully killing worker 1 (pid: 31406)...
  worker 1 buried after 1 seconds
  binary reloading uWSGI...
  chdir() to /etc/uwsgi/vassals
  closing all non-uwsgi socket fds &gt; 2 (max_fd = 1024)...
  found fd 3 mapped to socket 0 (/tmp/uwsgi-gsd.sock)
  running /usr/bin/uwsgi
  *** has_emperor mode detected (fd: 7) ***
  [uWSGI] getting INI configuration from gsd.ini
  *** Starting uWSGI 2.0.14 (64bit) on [Tue Feb  7 10:49:13 2017] ***
  compiled with version: 6.3.1 20170109 on 18 January 2017 00:35:47
  os: Linux-3.14.32-xxxx-grs-ipv6-64 #7 SMP Wed Jan 27 18:05:09 CET 2016
  nodename: renard
  machine: x86_64
  clock source: unix
  pcre jit disabled
  detected number of CPU cores: 4
  current working directory: /etc/uwsgi/vassals
  detected binary path: /usr/bin/uwsgi
  chdir() to /home/webapps/gsd
  your processes number limit is 15700
  your memory page size is 4096 bytes
  detected max file descriptor number: 1024
  lock engine: pthread robust mutexes
  thunder lock: disabled (you can enable it with --thunder-lock)
  uwsgi socket 0 inherited UNIX address /tmp/uwsgi-gsd.sock fd 3
  Python version: 3.6.0 (default, Jan 16 2017, 12:12:55)  [GCC 6.3.1 20170109]
  PEP 405 virtualenv detected: /home/toogy/.pyenv/versions/gsd
  Set PythonHome to /home/toogy/.pyenv/versions/gsd
  *** Python threads support is disabled. You can enable it with --enable-threads ***
  Python main interpreter initialized at 0x39d21f0
  your server socket listen backlog is limited to 100 connections
  your mercy for graceful operations on workers is 60 seconds
  mapped 145536 bytes (142 KB) for 1 cores
  *** Operational MODE: single process ***
  added /home/webapps/gsd/ to pythonpath.
  Traceback (most recent call last):
    File "/home/webapps/gsd/gsd/wsgi.py", line 12, in &lt;module&gt;
      from django.core.wsgi import get_wsgi_application
  ModuleNotFoundError: No module named 'django'
  unable to load app 0 (mountpoint='') (callable not found or import error)
  *** no app loaded. going in full dynamic mode ***
  *** uWSGI is running in multiple interpreter mode ***
  gracefully (RE)spawned uWSGI master process (pid: 27844)
  spawned uWSGI worker 1 (pid: 32312, cores: 1)
  </code></pre>
  
  <p>It cannot find <code>django</code> and I have no idea why because <code>uwsgi</code> seems to detect the python environment (in which <code>django</code> <strong>is</strong> installed).</p>
  
  <p>Also, it says <code>Python version: 3.6.0</code> while my virtualenv Python version is <strong>3.5.2</strong>. I don't know if this is supposed to happen. The system Python version is <strong>3.6.0</strong>.</p>
  
  <p>I am using the last versions of the <code>uwsgi</code> and <code>uwsgi-plugins-python</code> Arch Linux official packages.</p>