title: ImportError after cython embed
body: <p>I can't get otherwise-available modules seen by a compiled python script. How do I need to change the below process in order to accept either venv-based or global modules?</p>
  
  <p>Steps:</p>
  
  <pre class="lang-sh prettyprint-override"><code>$ python3 -m venv sometest
  $ cd sometest
  $ . bin/activate
  (sometest) $ pip3 install PyCrypto Cython
  </code></pre>
  
  <p>The basic script, using a non-standard module <code>Crypto</code>:</p>
  
  <pre class="lang-py prettyprint-override"><code># hello.py
  from Crypto.Cipher import AES
  import base64
  obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
  msg = "The answer is no"
  ciphertext = obj.encrypt(msg)
  print(msg)
  print(base64.b64encode(ciphertext))
  </code></pre>
  
  <pre class="lang-sh prettyprint-override"><code>(sometest) $ python3 hello.py
  The answer is no
  b'1oONZCFWVJKqYEEF4JuL8Q=='
  </code></pre>
  
  <p>Compiling it:</p>
  
  <pre class="lang-sh prettyprint-override"><code>(sometest) $ cython -3 --embed hello.py
  (sometest) $ gcc -Os -I /usr/include/python3.5m -o hello hello.c -lpython3.5m -lpthread -lm -lutil -ldl
  (sometest) $ $ ./hello
  Traceback (most recent call last):
    File "hello.py", line 1, in init hello
      from Crypto.Cipher import AES
  ImportError: No module named 'Crypto'
  </code></pre>
  
  <p>I don't think it's a problem with using the venv from a cython-embedded-compiled script: the script works elsewhere in the system without the venv (that is, <code>python3 -c 'from Crypto.Cipher import AES'</code> does not fail).</p>
  
  <p>The process works fine otherwise:</p>
  
  <pre class="lang-sh prettyprint-override"><code>(sometest) $ echo 'print("hello world")' &gt; hello2.py
  (sometest) $ cython -3 --embed hello2.py
  (sometest) $ gcc -Os -I /usr/include/python3.5m -o hello2 hello2.c -lpython3.5m -lpthread -lm -lutil -ldl
  (sometest) $ ./hello2
  hello world
  </code></pre>
  
  <p>System:</p>
  
  <pre class="lang-sh prettyprint-override"><code>(sometest) $ python3 --version
  Python 3.5.2
  (sometest) $ pip3 freeze
  Cython==0.29.11
  pkg-resources==0.0.0
  pycrypto==2.6.1
  
  (sometest) $ cat /etc/lsb-release
  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=16.04
  DISTRIB_CODENAME=xenial
  DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
  </code></pre>