I am trying to run the command on windows:
pip install mysql-python
to be able to work with mysql in Django but I get these errors:
c:\users\fabia\appdata\local\programs\python\python35-32\include\pyconfig.h(243): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
I can't find the solution, if someone knows something I would appreciate it, I have python 3.5 and visual studio 2015 with VC++ compiler.
There is a similar post: Error installing mysql-python but it has not given me a solution.
Another option is to install Anaconda , which will install a bunch of libraries for you, including the one you want to install.
On the other hand, to use mysql from python, there is a native library in Python PySQLdb , which in my experience is less problematic when installing.
You will also need to install the windows SDK that comes with Visual Studio 2015. That is where the
basestd.h
missing file is.Try downloading the binary file directly from the following page:
http://www.lfd.uci.edu/%7Egohlke/pythonlibs/#mysqlclient
It is a website of the University of California that provides binary files for Windows of many Python libraries, especially in the scientific field. It is generally very up-to-date (it already has the versions for the new Python 3.6 for example) and in the event of compilation problems or to install Numpy+MKL it works very well.
Follow these steps:
❶ Choose the version for python 3.5 32 or 64 bits depending on which one you use.
❷ Once downloaded you go to the directory where the download is and open CMD in that directory.
❸ Finally you use pip install followed by the full name (with extension included) of the downloaded file.
For example, if you downloaded to the Downloads folder it would be something like this (it's just an example):
C:\User\TuUsuario\Dowloads> python -m pip install mysqlclient-1.3.8-cp35-cp35m-win_amd64.whl
I don't remember if this fork needed any dependencies, if it gives you an error due to a missing module just install it with pid before and then run the mysqlclient installation again
When it gave me an error when installing mysql-python I have done it in the following way:
This has worked for me several times and with several projects.
I recently ran into a similar problem with a co-worker. You can use:
It worked for me.