when I try to install pip install MySQL-python on windows 10 I got :
C:\Users\ghina>pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ghina\\AppData\\Local\\Temp\\pip-build-eo59erqx\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ghina\AppData\Local\Temp\pip-b4pe3d_p-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying _mysql_exceptions.py -> build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb
creating build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ghina\\AppData\\Local\\Temp\\pip-build-eo59erqx\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ghina\AppData\Local\Temp\pip-b4pe3d_p-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ghina\AppData\Local\Temp\pip-build-eo59erqx\MySQL-python\
I'm on windows 10 using python 3.5 and django 1.9 , and I want to connect django to mysql database . When I run django server I get : No module named 'MySQLbd'
MySQL-Python does not support Python 3.x. According to the official Django documentation you can use one of the following drivers:
The Python Database API is described in PEP 249. MySQL has three prominent drivers that implement this API:
MySQLdb is a native driver that has been developed and supported for
over a decade by Andy Dustman.
mysqlclient is a fork of MySQLdb which
notably supports Python 3 and can be used as a drop-in replacement for
MySQLdb. At the time of this writing, this is the recommended choice
for using MySQL with Django.
MySQL Connector/Python is a pure Python
driver from Oracle that does not require the MySQL client library or
any Python modules outside the standard library.
Related
This question already has answers here:
Installing numpy with pip on windows 10 for python 3.7
(4 answers)
Closed 2 years ago.
I need to download the package psycopg2 in order to work with the postgresql database in use. Unfortunately, when I try to pip install psycopg2 the following error pops up:
failed building wheel for psycopg2
my os: windows
log
Building wheel for psycopg2-binary (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Windows 10\.virtualenvs\project-e1HiiE3H\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Windows 10\\AppData\\Local\\Temp\\pip-install-u7m2a_o9\\psycopg2-binary\\setup.py'"'"'; __file__='"'"'C:\\Users\\Windows 10\\AppData\\Local\\Temp\\pip-install-u7m2a_o9\\psycopg2-binary\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Windows 10\AppData\Local\Temp\pip-wheel-bv5plcfw'
cwd: C:\Users\Windows 10\AppData\Local\Temp\pip-install-u7m2a_o9\psycopg2-binary\
Complete output (24 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\psycopg2
copying lib\compat.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\errorcodes.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\errors.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\extensions.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\extras.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\pool.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\sql.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\tz.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_ipaddress.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_json.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_lru_cache.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_range.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\__init__.py -> build\lib.win-amd64-3.9\psycopg2
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'psycopg2._psycopg' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
Solution no 1 (no need for compilation):
pip install psycopg2-binary
Solution no 2:
get a C compiler
pip install psycopg2
I'm trying to install the CVXPY package, which has OSQP as a dependency, but I'm failing miserably at installing it. This is the log:
Microsoft Windows [Version 10.0.18362.476]
(c) 2019 Microsoft Corporation. Alle Rechte vorbehalten.
C:\WINDOWS\system32>pip install osqp
Collecting osqp
Using cached https://files.pythonhosted.org/packages/ba/17/49790ce2ce7a6b95cd250642ebc68bd723ddefdd052ee8dcc1e0dcf4ffca/osqp-0.6.1.tar.gz
Requirement already satisfied: numpy>=1.7 in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (1.17.4)
Requirement already satisfied: scipy>=0.13.2 in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (1.3.2)
Requirement already satisfied: future in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (0.18.2)
Installing collected packages: osqp
Running setup.py install for osqp ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\felix\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\felix\AppData\Local\Temp\pip-record-0cy159dw\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\felix\AppData\Local\Temp\pip-install-3lddfze1\osqp\
Complete output (93 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\osqp
copying module\interface.py -> build\lib.win32-3.8\osqp
copying module\utils.py -> build\lib.win32-3.8\osqp
copying module\__init__.py -> build\lib.win32-3.8\osqp
creating build\lib.win32-3.8\osqp\codegen
copying module\codegen\code_generator.py -> build\lib.win32-3.8\osqp\codegen
copying module\codegen\utils.py -> build\lib.win32-3.8\osqp\codegen
copying module\codegen\__init__.py -> build\lib.win32-3.8\osqp\codegen
creating build\lib.win32-3.8\osqp\tests
copying module\tests\basic_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\codegen_matrices_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\codegen_vectors_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\dual_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\feasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\mkl_pardiso_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\non_convex_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\polishing_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\primal_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\unconstrained_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\update_matrices_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\warm_start_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\__init__.py -> build\lib.win32-3.8\osqp\tests
creating build\lib.win32-3.8\osqppurepy
copying modulepurepy\interface.py -> build\lib.win32-3.8\osqppurepy
copying modulepurepy\_osqp.py -> build\lib.win32-3.8\osqppurepy
copying modulepurepy\__init__.py -> build\lib.win32-3.8\osqppurepy
running egg_info
writing osqp.egg-info\PKG-INFO
writing dependency_links to osqp.egg-info\dependency_links.txt
writing requirements to osqp.egg-info\requires.txt
writing top-level names to osqp.egg-info\top_level.txt
reading manifest file 'osqp.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'osqp.egg-info\SOURCES.txt'
creating build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\emosqpmodule.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\example.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\setup.py -> build\lib.win32-3.8\osqp\codegen\files_to_generate
creating build\lib.win32-3.8\osqp\codegen\sources
creating build\lib.win32-3.8\osqp\codegen\sources\configure
copying module\codegen\sources\configure\osqp_configure.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
copying module\codegen\sources\configure\qdldl_types.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
creating build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\auxil.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\constants.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\error.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\glob_opts.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\kkt.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\lin_alg.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\osqp.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\proj.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\qdldl.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\qdldl_interface.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\scaling.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\types.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\util.h -> build\lib.win32-3.8\osqp\codegen\sources\include
creating build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\auxil.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\error.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\kkt.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\lin_alg.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\osqp.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\proj.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\qdldl.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\qdldl_interface.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\scaling.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\util.c -> build\lib.win32-3.8\osqp\codegen\sources\src
running build_ext
-- Selecting Windows SDK version to target Windows 10.0.18362.
CMake Error at CMakeLists.txt:5 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
Das System kann die angegebene Datei nicht finden
-- Configuring incomplete, errors occurred!
See also "C:/Users/felix/AppData/Local/Temp/pip-install-3lddfze1/osqp/osqp_sources/build/CMakeFiles/CMakeOutput.log".
Das System kann die angegebene Datei nicht finden
CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe osqpstatic.vcxproj /p:Configuration=Release /p:Platform=Win32 /p:VisualStudioVersion=14.0 /v:m &&
error: [Errno 2] No such file or directory: 'osqp_sources\\build\\out\\Release\\osqp.lib'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\felix\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\felix\AppData\Local\Temp\pip-record-0cy159dw\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
It seems it is a problem with the MSBuildTools. I've installed the build tools as instructed on the CVXPY-webpage: https://drive.google.com/file/d/0B4GsMXCRaSSIOWpYQkstajlYZ0tPVkNQSElmTWh1dXFaYkJr/view
That didn't work. Then I found this question (Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualst udio.com/visual-cpp-build-tools) and modified the build tools installation accordingly but it still doesn't work. I don't have the python developement under Web & cloud as in the screenshot, but this should be optional anyway.
Could you please help me?
P.S.: Das System kann die angegebene Datei nicht finden roughly translates to The system can't find the specified file
EDIT: Here's the build tools installation, just in case:
I was facing the same issue. From the link https://www.lfd.uci.edu/~gohlke/pythonlibs/#osqp (posted by phd), downloaded the corresponding version of osqp and install it using (for instance):
pip install osqp-0.6.1-cp38-cp38-win_amd64.whl
Then, you should be able to simply install cvxpy using
pip install cvxpy
I am one of the developers. OSQP pip wheels for python 3.8 are online now. It should fix your problem.
I am trying to install pip install mysqlclient and it fails everytime. I also tried pip install --only-binary :all: mysqlclient and also not worked. Then I also downloaded whl file and also did't work. I need help.
Using python 3.7.2 and pip 19.0.2 version.
Here's the whole error thats pop up:
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\vertig~1.0\envs\mypro\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\VERTIG~1.0\\AppData\\Local\\Temp\\pip-install-b81i8gmq\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\VERTIG~1.0\AppData\Local\Temp\pip-record-6s1gmot9\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\vertig~1.0\envs\mypro\include\site\python3.7\mysqlclient:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\vertig~1.0\envs\mypro\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\VERTIG~1.0\\AppData\\Local\\Temp\\pip-install-b81i8gmq\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\VERTIG~1.0\AppData\Local\Temp\pip-record-6s1gmot9\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\vertig~1.0\envs\mypro\include\site\python3.7\mysqlclient" failed with error code 1 in C:\Users\VERTIG~1.0\AppData\Local\Temp\pip-install-b81i8gmq\mysqlclient\```
So any ideas where the error is getting?
Check that you have MySQL installed on your system.
On Mac:
brew install mysql
Installing with APT (eg, Ubuntu):
sudo apt install mysql-server
Or install with the installer: https://dev.mysql.com/downloads/installer/.
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft
Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
From the error message its pretty clear that the issue is with with C++ installation on your machine.
FYI: Many Python libs uses C++ under the hood so its mandatory to install the Microsoft visual c++(on windows) as mentioned in the error.
You can go ahead and install Microsoft Visual C++ from here or here
Or else if there is no particular use behind mysqlclient you can use this pure pyython MySQL client library named PyMySQL (you need not install visual c++ for using this lib).
I am trying to install mysql-python, I have tried two methods in pip
python -m pip install mysql-python
This does not work saying "Failed Building Wheel for MySQL-Python"
Downloading the wheels MySQL_python-1.2.5-cp27-none-win_amd64 and MySQL_python-1.2.5-cp27-none-win32 and trying to install each of them separately with the command
python -m pip install filename
This does not work in each case saying it is "not supported on this platform'
Does any one know what is wrong and how I can install mysql-python?
Update
Since writing this I am still having trouble getting MySQLdb working but have tried a few more things.
1) I am using Python 3.5 mysql-python is for Python 2.x, I should have been trying to install mysqlclient. However I am now having similar issues as above installing mysqlclient both with wheels and with just pip.
> pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.10.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\teddy\\appdata\\local\\temp\\pip-build-lhtha0\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\teddy\appdata\local\temp\pip-stnbio-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
copying _mysql_exceptions.py -> build\lib.win32-2.7
creating build\lib.win32-2.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-2.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-2.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-2.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-2.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-2.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-2.7\MySQLdb
creating build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Users\teddy\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,3,10,'final',0) -D__version__=1.3.10 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobuild\temp.win32-2.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29) : fatal error C1083: Cannot open include file: 'my_config.h': No such file or directory
error: command 'C:\\Users\\teddy\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\teddy\\appdata\\local\\temp\\pip-build-lhtha0\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\teddy\appdata\local\temp\pip-stnbio-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\teddy\appdata\local\temp\pip-build-lhtha0\mysqlclient\
2) I have tried installing MySQL connector C. This hasn't changed anything.
3) I have tried getting it working on Spyder the IDE that comes with Anaconda
So can anyone suggest anything else
I finally did it. There were two things I changed to get it working:
My Pip was pointing to an older version of Python I had on my
computer and for some reason Idle was picking it up but not Spyder.
I had to move one of the mysql connector files from:
C:\Program Files\MySQL to C:\Program Files (x86)\MySQL
I'm trying to download through pip the MySql-python connector as following, however im getting an error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
C:\Users\yschellekens.INTRANET\Desktop\Django project\general>pip install MySQL-
python
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python
Complete output from command C:\Python33\python.exe -c "import setuptools;__fi
le__='c:\\users\\yschel~1.int\\appdata\\local\\temp\\pip-build-wc92bo\\MySQL-pyt
hon\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" bdist_wheel -d c:\users\yschel~1.int\appdata\local\temp\tmpc71e54pi
p-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.3
copying _mysql_exceptions.py -> build\lib.win32-3.3
creating build\lib.win32-3.3\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.3\MySQLdb
creating build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.3\MySQLdb\constan
ts
copying MySQLdb\constants\ER.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.3\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
----------------------------------------
Failed building wheel for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
Complete output from command C:\Python33\python.exe -c "import setuptools, t
okenize;__file__='c:\\users\\yschel~1.int\\appdata\\local\\temp\\pip-build-wc92b
o\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__
).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\ys
chel~1.int\appdata\local\temp\pip-ckxp_c-record\install-record.txt --single-vers
ion-externally-managed --compile:
running install
running build
running build_py
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
----------------------------------------
Command "C:\Python33\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\yschel~1.int\\appdata\\local\\temp\\pip-build-wc92bo\\MySQL-python\\setup.p
y';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --record c:\users\yschel~1.int\appdata\local
\temp\pip-ckxp_c-record\install-record.txt --single-version-externally-managed -
-compile" failed with error code 1 in c:\users\yschel~1.int\appdata\local\temp\p
ip-build-wc92bo\MySQL-python
I found this wonderful question, which was very helpful:
Install mysql-python (Windows)
But im still running into issues, i know that i can download Visual Studio 2010 but i saw people who mention that its not necessary, and i prefer not to download it.
Here are my PYTHONPATH + PATH
PATH:
C:\Tools\OpenVPN\bin;C:\Python33\;C:\Program Files\Java\jdk1.7.0_15\bin;C:\Program Files\Java\jdk1.7.0_15\jre\bin\server;C:\Python33\Lib\site-packages;C:\Python33\Lib;C:\Python33\DLLs;C:\Python33\Lib\lib-tk;C:\Python33\Scripts;C:\Windows\System32;C:\Program Files\MySQL\MySQL Server 5.6\bin
PYTHONPATH
C:\Python33;C:\Python33\Lib\site-packages;C:\Python33\Lib;C:\Python33\DLLs;C:\Python33\Lib\lib-tk;C:\Python33\Scripts
Did i miss anything?
Any help in that would be great!
What you need is to have Microsoft Visual C++ 10.0 compiler (and as far as I remember version 10.0 doesn't necessarily mean Visual Studio 2010) installed on your system and vcvarsall.bat accessible from PATH environment variable.
However, it is usual for Windows to have enormous amount of blocking issues connected with compiling python extensions via pip (or it's just me?), so my usual workaround of the error you get is to google some Windows binary installers (mysql-python for 2.7 for instance) or .whl files. Both have python extensions compiled for a particular Python and architecture thus eliminating the need in having C or C++ compiler installed.