I'm trying to install mysqldb for Python.
I'm running "pip install mysql-python"
and I keep getting this error:
running build_ext
building '_mysql' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'fi
nal',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobui
ld\temp.win32-2.7\Release_mysql.obj /Zl
_mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
----------------------------------------
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:\python27\python.exe -c "import setuptools, tokenize;file='c:\users\scott~1.sco\appdata\local\temp\pip-bu
ild-nja4gr\mysql-python\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install -
-record c:\users\scott~1.sco\appdata\local\temp\pip-5htk1y-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb
running build_ext
building '_mysql' extension
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'
final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fob
uild\temp.win32-2.7\Release_mysql.obj /Zl
_mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -c "import setuptools, tokenize;file='c:\users\scott~1.sco\appdata\local\temp\pip-build-nja4gr\mysql-python
\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\scott~1
.sco\appdata\local\temp\pip-5htk1y-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\scott
~1.sco\appdata\local\temp\pip-build-nja4gr\mysql-python
Can anyone tell me whats the problem?
Download the pre-compiled whl file for mysql-python from from Christophe Gohlke’s Library of pre-compiled python packages for windows from the below location.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
Now got to directory where you downloaded that file and open command prompt there.
Now run below command pip install xxx.whl
Best Luck !!
You can try...
pip install mysqlclient==1.3.4
It worked for me.
If the above command doesn't work try this...
pip install --only-binary :all: mysqlclient
both worked for me.
I got a same error.
I solved it by install mysql-connector
You can get a pre-compiled version from Christophe Gohlke’s Library of pre-compiled python packages for windows. Specifically, you can find the MySQL_python package here
Other alternatives would be to use a python distribution that comes with many packages pre-compiled and available for easy installation. Two examples are:
Anaconda Python Distribution
Enthought Canopy Python Distribution
You are missing Visual Studio C++ from your system or the correct environment for VS is not set properly based on the error in your question: "error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2"
Please check if you have C++ compiler installed at "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe". If you do not have this installed it is available from Microsoft here: python27 Compiler
If you have VS installed try running the pip install from visual studio command prompt ,which generally would have all the environment created or try to run vcvarsall.bat from "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\" folder
Simply go to the site:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
and download mysqlclient wheel file according to your python version and operating system bit specification, then install the downloaded file with typing
pip install downloaded_whl_file_name
Finally install mysqldb with command:
pip install flask-mysqldb
In my case I had to install mysql-connector with the same bitness as my python.
So although I run 64bit windows 10, I have 32bit python 2.7 installed so I had to install 32bit mysql-connector from here
to overcome the error.
The following action, mentioned above by zio, has solved my problem:
You can get a pre-compiled version from Christophe Gohlke’s Library of pre-compiled python packages for windows. Specifically, you can find the MySQL_python package here.
After get the file, install it using pip install.
Related
After upgrading Python to 3.11, Locust-plugin fails to install as one of its dependency throws error
First it asked me to install VC++ > 14.0
After installing VC++ build tools 15, still it throws a different error
Note: We do not see this issue until Python 3.10.8
Kindly let me know if there is any fix?
locust-plugins==2.7.1
- confluent-kafka [required: Any]
DEPRECATION: confluent-kafka is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 2
3.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for confluent-kafka ... error
error: subprocess-exited-with-error
× Running setup.py install for confluent-kafka did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
running install
C:\~\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use bu
ild and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
.............build\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src
creating build\temp.win-amd64-cpython-311\Release\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka
creating build\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\~\AppData\
Local\Programs\Python\Python311\include -IC:\~\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\M
SVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)
\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\inIC:\~\AppData\Local\Programs\Python\Python311\include -IC:\~\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files
(x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /TcC:\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src\Admin.c /Fobuild\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src\Admin.obj
Admin.c c:\~\appdata\local\temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src\confluent_kafka.h(23): fatal error C1083: Cannot open include file: 'librdkafka/rdkafka.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> confluent-kafka
Right now there is currently no pre-built version of confluent-kafka for 3.11. Hopefully it is on the way though: https://github.com/confluentinc/confluent-kafka-python/issues/1452
Also, I think the reason cannot build from source is that you need librdkafka installed. I dont know what the windows equivalent is, but apparently someone got it working on Linux this way:
apt-get install -y --no-install-recommends gcc git libssl-dev g++ make && cd /tmp && git clone https://github.com/edenhill/librdkafka.git && cd librdkafka && ./configure --prefix=/usr && make && make install
Looks like we are still waiting for 3.11 confluent-kafka. This is the only thing that is blocking my 3.10 to 3.11 upgrade.
I am trying to get my cocotb work with commercial simulators (either modelsim or activeHDL) and I would appreciate if someone could help me get them up and running.
I have a Windows machine where I have installed MSYS2 and anaconda3 from where I can install cocotb. I don't have problem installing (I presume stable) cocotb with pip install cocotb through anaconda prompt, however, when I want to install the development version of cocotb through pip install https://github.com/cocotb/cocotb/archive/master.zip I run into trouble.
Initially, the installation complained about visual studio c++14 not being installed. I decided to install visual Studio build tools and hope it will install but then the installation failed due to following error
building 'cocotb\libs\libcocotbutils' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\cocotb
creating build\temp.win-amd64-3.7\Release\cocotb\share
creating build\temp.win-amd64-3.7\Release\cocotb\share\lib
creating build\temp.win-amd64-3.7\Release\cocotb\share\lib\utils
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icocotb\share\include -IC:\Users\Mehdi\anaconda3\include -IC:\Users\Mehdi\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpcocotb\share\lib\utils\cocotb_utils.cpp /Fobuild\temp.win-amd64-3.7\Release\cocotb\share\lib\utils\cocotb_utils.obj -std=c++11 -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion -Wnon-virtual-dtor -Woverloaded-virtual -D__STDC_FORMAT_MACROS
cl : Command line error D8021 : invalid numeric argument '/Wextra'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Is this a problem with cocotb's development version or do I miss something? how can I force cocotb use msys2 build tools instead of visual studio's?
PS. The reason I am trying to install the development version is because of activehdl.
You need set MinGW as the default compiler one way is to:
pip install --global-option build_ext --global-option --compiler=mingw32 https://github.com/cocotb/cocotb/archive/master.zip
More info: How to use MinGW's gcc compiler when installing Python package using Pip?
I will try to add this to the documentation.
I've been trying to install Tesseract-ocr library for a long time. Read many similar problems related with other packages and given solutions and none worked.
I think problem is about the my Microsoft Visual Studio. There is an error given the code below:
error: command 'c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\Bin\x86_amd64\cl.exe' failed with exit status 2
I uninstalled, reinstalled, updated and tried many things but still not working :(
Thanks already now!
C:\Users\af>pip install tesseract-ocr
Collecting tesseract-ocr
Using cached tesseract-ocr-0.0.1.tar.gz
Requirement already satisfied: cython in c:\python34\lib\site-packages (from tesseract-ocr)
Building wheels for collected packages: tesseract-ocr
Running setup.py bdist_wheel for tesseract-ocr ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\af\\AppData\\Local\\Temp\\pip-build-ggf9qvw1\\tesseract-ocr\\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\af\AppData\Local\Temp\tmpdnkpad7cpip-wheel- --python-tag cp34:
running bdist_wheel
running build
running build_py
file tesseract_ocr.py (for module tesseract_ocr) not found
file tesseract_ocr.py (for module tesseract_ocr) not found
running build_ext
building 'tesseract_ocr' extension
creating build
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\python34\include -Ic:\python34\include /Tptesseract_ocr.cpp /Fobuild\temp.win-amd64-3.4\Release\tesseract_ocr.obj
tesseract_ocr.cpp
tesseract_ocr.cpp(463) : fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for tesseract-ocr
Running setup.py clean for tesseract-ocr
Failed to build tesseract-ocr
Installing collected packages: tesseract-ocr
Running setup.py install for tesseract-ocr ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\af\\AppData\\Local\\Temp\\pip-build-ggf9qvw1\\tesseract-ocr\\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\af\AppData\Local\Temp\pip-tcjuee8m-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
file tesseract_ocr.py (for module tesseract_ocr) not found
file tesseract_ocr.py (for module tesseract_ocr) not found
running build_ext
building 'tesseract_ocr' extension
creating build
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\python34\include -Ic:\python34\include /Tptesseract_ocr.cpp /Fobuild\temp.win-amd64-3.4\Release\tesseract_ocr.obj
tesseract_ocr.cpp
tesseract_ocr.cpp(463) : fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\af\\AppData\\Local\\Temp\\pip-build-ggf9qvw1\\tesseract-ocr\\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\af\AppData\Local\Temp\pip-tcjuee8m-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\af\AppData\Local\Temp\pip-build-ggf9qvw1\tesseract-ocr\
consider using pytesseract, worked for me on python 3.6: pip install pytesseract
If you encounter problems installing it directly by running the above command, try this link :
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Use the "find" tool to find pytesseract and in the directory where its downloaded, hold shift and right click, youll get an option to open a command window there and run:
pip install "filename"
You could also try downloading tesseract-ocr from the link above and perform the installation offline like i just explained.
Never quite figured out why, but some installations that failed worked when dowloaded. Hope that helps.
The fix for this issue is on the Compiling Page of tesseract-ocr
sudo apt-get install libleptonica-dev
I can tell you that this fixed the issue on a Raspberry Pi (Jessie and Stretch) and Debian (8 and 9)
I've been looking through endless forums trying to solve this and I still haven't found an answer that works. I'm new to windows and I'm trying to set things up as I have them on my Mac but the Command Line is presented challenges (what's the equivalent to sudo?) eg, on mac I would type 'sudo pip install scrapy', what's the equivalent on windows? I'm getting this error below and I cannot seem to find my way around it. Any thoughts greatly appreciated.
C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes -Ic:\python27\include -Ic:\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win32-2.7\Release\src\lxml\lxml.etree.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Users\\kenma\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
creating users
creating users\kenma
creating users\kenma\appdata
creating users\kenma\appdata\local
creating users\kenma\appdata\local\temp
C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c /Fousers\kenma\appdata\local\temp\xmlXPathInitdw65bp.obj
xmlXPathInitdw65bp.c
c:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\kenma\\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\\kenma\\appdata\\local\\temp\\pip-build-c6lrhk\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\kenma\appdata\local\temp\pip-vhli1l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\kenma\appdata\local\temp\pip-build-c6lrhk\lxml\
This seems to be related to lxml installation which is a scrapy dependency.
The official documentation page has some solutions but it recommends to use unofficial binaries for windows operating system which can be found here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
I'm trying to install mysqldb for Python. I'm running "pip install mysql-python" and I keep getting this error:
running build_ext
building '_mysql' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'fi nal',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobui ld\temp.win32-2.7\Release_mysql.obj /Zl _mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
--------------------------------------
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:\python27\python.exe -c "import setuptools, tokenize;file='c:\users\scott~1.sco\appdata\local\temp\pip-bu ild-nja4gr\mysql-python\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install - -record c:\users\scott~1.sco\appdata\local\temp\pip-5htk1y-record\install-record.txt --single-version-externally-managed --compile: running install
running build
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb
running build_ext
building '_mysql' extension
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,' final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fob uild\temp.win32-2.7\Release_mysql.obj /Zl _mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
--------------------------------------
Command "c:\python27\python.exe -c "import setuptools, tokenize;file='c:\users\scott~1.sco\appdata\local\temp\pip-build-nja4gr\mysql-python \setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\scott~1 .sco\appdata\local\temp\pip-5htk1y-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\scott ~1.sco\appdata\local\temp\pip-build-nja4gr\mysql-python
Would someone help? I am new to Python.
That's because you have an Incompatible MySQL-C/Python connector for Python. Latest Connector comes only for Python3.
Just follow these steps:
Download, MySQL-C/Python27 Connector
Install it.
Open CMD as admin.
Type the following in CMD.
mklink /d "C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2" "C:\Program Files\MySQL\MySQL Connector C 6.0.2"
Try installing now, python -m pip install MySQL-Python
TaDa! It works!
This answer is from All of common comments in asked question of this type!
Download the 32-bit version from MySQL-C Download Page
Try installing now, python -m pip install MySQL-Python
Worked perfectly for me. You have to install the 32-bit version even inside a 64-bit Windows environment.