title: Object type <class 'str'> cannot be passed to C code - virtual environment
body: <p>I am using Mac Anaconda. And I try to use the AES of Crypto. However, I face a strange problem.</p>
  <p>I just want to excute a simple line of code:</p>
  <pre><code> obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
  </code></pre>
  <p>if I run the code without the virtual environment as below it is OK.</p>
  <pre><code>$ python
  
  Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) 
  [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more 
  information.
  &gt;&gt;&gt; from Crypto.Cipher import AES
  
  &gt;&gt;&gt; obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
  </code></pre>
  <p>if I run with the virtual environment &quot;testaes&quot; then I got the error:</p>
  <pre><code>(testaes)$ python
  Python 3.6.4 |Anaconda, Inc.| (default, Mar 12 2018, 20:05:31) 
  [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt; from Crypto.Cipher import AES
  
  &gt;&gt;&gt; obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
  Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/Applications/anaconda3/envs/testaes/lib/python3.6/site-packages/Crypto/Cipher/AES.py&quot;, line 200, in new
  return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File &quot;/Applications/anaconda3/envs/testaes/lib/python3.6/site-packages/Crypto/Cipher/__init__.py&quot;, line 55, in _create_cipher
  return modes[mode](factory, **kwargs)
  File &quot;/Applications/anaconda3/envs/testaes/lib/python3.6/site-packages/Crypto/Cipher/_mode_cbc.py&quot;, line 234, in _create_cbc_cipher
  cipher_state = factory._create_base_cipher(kwargs)
  File &quot;/Applications/anaconda3/envs/testaes/lib/python3.6/site-packages/Crypto/Cipher/AES.py&quot;, line 100, in _create_base_cipher
  result = start_operation(c_uint8_ptr(key),
  File &quot;/Applications/anaconda3/envs/testaes/lib/python3.6/site-packages/Crypto/Util/_raw_api.py&quot;, line 109, in c_uint8_ptr
  raise TypeError(&quot;Object type %s cannot be passed to C code&quot; % type(data))
  TypeError: Object type &lt;class 'str'&gt; cannot be passed to C code
  </code></pre>
  <p>You can see that at both time I use the the same Anaconda Python 3.6.4 and GCC4.2.1. How to solve this?</p>