title: Unable to install mysqlclient in python3 virtualenv
body: <p>I want to run django with MySQL and Python 3. I initialized virtual environment with <code>virtualenv --no-site-packages -p python3 ./</code>. Then I installed django and wheel using pip, so pip freeze gives </p>
  
  <pre><code>django==1.8.3
  wheel==0.24.0
  </code></pre>
  
  <p>Then I tried installing mysqlclient with <code>pip install mysqlclient</code>, but it ended with</p>
  
  <pre><code>Downloading/unpacking mysqlclient
  Downloading mysqlclient-1.3.6.tar.gz (78kB): 78kB downloaded
  Running setup.py (path:/tmp/pip-build-jpdlrnc8/mysqlclient/setup.py) egg_info for package mysqlclient
  
  Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient
  building '_mysql' extension
  i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/usr/include/python3.4m -I/home/ondra/zelvovani/include/python3.4m -c _mysql.c -o build/temp.linux-i686-3.4/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DTAOCRYPT_DISABLE_X86ASM -g -DNDEBUG
  error: command 'i586-linux-gnu-gcc' failed with exit status 1
  Complete output from command /home/ondra/zelvovani/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-jpdlrnc8/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-fa_6nkh3-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ondra/zelvovani/include/site/python3.4:
  running install
  
  running build
  
  running build_py
  
  creating build
  
  creating build/lib.linux-i686-3.4
  
  copying _mysql_exceptions.py -&gt; build/lib.linux-i686-3.4
  
  creating build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/__init__.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/compat.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/converters.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/connections.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/cursors.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/release.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  copying MySQLdb/times.py -&gt; build/lib.linux-i686-3.4/MySQLdb
  
  creating build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/__init__.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/CR.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/FIELD_TYPE.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/ER.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/FLAG.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/REFRESH.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  copying MySQLdb/constants/CLIENT.py -&gt; build/lib.linux-i686-3.4/MySQLdb/constants
  
  running build_ext
  
  building '_mysql' extension
  
  creating build/temp.linux-i686-3.4
  
  i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/usr/include/python3.4m -I/home/ondra/zelvovani/include/python3.4m -c _mysql.c -o build/temp.linux-i686-3.4/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DTAOCRYPT_DISABLE_X86ASM -g -DNDEBUG
  
  error: command 'i586-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Cleaning up...
  Command /home/ondra/zelvovani/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-jpdlrnc8/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-fa_6nkh3-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ondra/zelvovani/include/site/python3.4 failed with error code 1 in /tmp/pip-build-jpdlrnc8/mysqlclient
  Storing debug log for failure in /home/ondra/.pip/pip.log
  </code></pre>
  
  <p>I have installed <code>libmysqlclient-dev</code>, <code>python3-dev</code>, <code>zlib1g-dev</code> (packages that were suggested in other questions here in stackoverflow).</p>
  
  <p>Do you have any ideas, what am I doing wrong?</p>