I am trying to use the pip install mysql-python command and I get the error below. I have no idea what this means someone please help. I have already updated my verison of pip and setuptools and wheels so I am at a loss. I get a big error message but only have the first half presented below.
C:\Users\Alex\Desktop\Cornell Stuff\Computer Programs\WinPython-64bit-
3.4.3.3\python-3.4.3.amd64>pip install mysql-python
Collecting mysql-python
Downloading MySQL-python-1.2.5.zip (108kB)
100% |################################| 112kB 179kB/s
Building wheels for collected packages: mysql-python
Running setup.py bdist_wheel for mysql-python ... error
Complete output from command "C:\Users\Alex\Desktop\Cornell Stuff\Computer
Programs\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\python.exe" -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-build-
1kxb8j7_\\mysql-python\\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\Alex\AppData\Local\Temp\tmpzz01n6ylpip-wheel- --python-tag cp34:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
copying _mysql_exceptions.py -> build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.4\MySQLdb
creating build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
C:\Users\Alex\Desktop\Cornell Stuff\Computer Programs\WinPython-64bit-
3.4.3.3\python-3.4.3.amd64\..\tools\mingw32\bin\gcc.exe -mdll -O -DMS_WIN64
-Wall -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:\Users\Alex\Desktop\Cornell Stuff\Computer Programs\WinPython-64bit-
3.4.3.3\python-3.4.3.amd64\include" "-IC:\Users\Alex\Desktop\Cornell
Stuff\Computer Programs\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\include"
-c _mysql.c -o build\temp.win-amd64-3.4\Release\_mysql.o /Zl
gcc: error: /Zl: No such file or directory
error: command 'C:\\Users\\Alex\\Desktop\\Cornell Stuff\\Computer
Programs\\WinPython-64bit-3.4.3.3\\python-
3.4.3.amd64\\..\\tools\\mingw32\\bin\\gcc.exe' failed with exit status 1
----------------------------------------
Failed building wheel for mysql-python
Running setup.py clean for mysql-python
Failed to build mysql-python
it's written there that mysql-python may not be python-3 compatible : https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
you may rather try, for example: "pip install mysql-connector-python"
Related
I've tried installing zipline-trader according to instructions given on zipline-trader installation page: https://zipline-trader.readthedocs.io/en/latest/install.html
All goes fine until actually running the installation command. Neither of these work:
pip install -e .
or
pip install zipline-trader
Installation starts, but problems begin when starting to build wheel for zipline-trader.
I'm not a huge computer wizard, so if someone could help me out here and tell me where the problem is. it would be much appreciated.
The error messages are below (very long list):
Building wheels for collected packages: bcolz, bottleneck, lru-dict
Building wheel for bcolz (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\matti\Zipline\venv-zipline\Scripts\python.exe' -u -c 'import sys, setuptools,
tokenize; sys.argv[0] = '"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install-
u0djao1v\\bcolz_ff25721e67224cf19d0fea2b456a1054\\setup.py'"'"';
__file__='"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install-
u0djao1v\\bcolz_ff25721e67224cf19d0fea2b456a1054\\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\matti\AppData\Local\Temp\pip-wheel-yk9_l_0r'
cwd: C:\Users\matti\AppData\Local\Temp\pip-install-
u0djao1v\bcolz_ff25721e67224cf19d0fea2b456a1054\
Complete output (42 lines):
SSE2 detected
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\bcolz
copying bcolz\arrayprint.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\attrs.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\chunked_eval.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\ctable.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\defaults.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\py2help.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\py2help_tests.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\toplevel.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\utils.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\version.py -> build\lib.win-amd64-3.6\bcolz
copying bcolz\__init__.py -> build\lib.win-amd64-3.6\bcolz
creating build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\all.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\common.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\test_attrs.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\test_carray.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\test_carray_objects.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\test_ctable.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\test_ndcarray.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\test_queries.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\tests\__init__.py -> build\lib.win-amd64-3.6\bcolz\tests
copying bcolz\carray_ext.pxd -> build\lib.win-amd64-3.6\bcolz
running build_ext
skipping 'bcolz\carray_ext.c' Cython extension (up-to-date)
building 'bcolz.carray_ext' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/
SSE2 detected
running bdist_wheel
running build
running build_py
copying bcolz\version.py -> build\lib.win-amd64-3.6\bcolz
running build_ext
skipping 'bcolz\carray_ext.c' Cython extension (up-to-date)
building 'bcolz.carray_ext' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for bcolz
Running setup.py clean for bcolz
Building wheel for bottleneck (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\matti\Zipline\venv-zipline\Scripts\python.exe' 'C:\Users\matti\Zipline\venv-
zipline\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel
'C:\Users\matti\AppData\Local\Temp\tmpi6jwni9b'
cwd: C:\Users\matti\AppData\Local\Temp\pip-install-
u0djao1v\bottleneck_4c2f93e8934942d2b56b70de3502ceed
Complete output (51 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\bottleneck
copying bottleneck\_pytesttester.py -> build\lib.win-amd64-3.6\bottleneck
copying bottleneck\_version.py -> build\lib.win-amd64-3.6\bottleneck
copying bottleneck\__init__.py -> build\lib.win-amd64-3.6\bottleneck
creating build\lib.win-amd64-3.6\bottleneck\benchmark
copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
creating build\lib.win-amd64-3.6\bottleneck\slow
copying bottleneck\slow\move.py -> build\lib.win-amd64-3.6\bottleneck\slow
copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-3.6\bottleneck\slow
copying bottleneck\slow\reduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
copying bottleneck\slow\__init__.py -> build\lib.win-amd64-3.6\bottleneck\slow
creating build\lib.win-amd64-3.6\bottleneck\src
copying bottleneck\src\bn_config.py -> build\lib.win-amd64-3.6\bottleneck\src
copying bottleneck\src\bn_template.py -> build\lib.win-amd64-3.6\bottleneck\src
copying bottleneck\src\__init__.py -> build\lib.win-amd64-3.6\bottleneck\src
creating build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\input_modification_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\memory_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\move_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\util.py -> build\lib.win-amd64-3.6\bottleneck\tests
copying bottleneck\tests\__init__.py -> build\lib.win-amd64-3.6\bottleneck\tests
UPDATING build\lib.win-amd64-3.6\bottleneck/_version.py
set build\lib.win-amd64-3.6\bottleneck/_version.py to '1.3.2'
running build_ext
running config
compiling '_configtest.c':
int __attribute__((optimize("O3"))) have_attribute_optimize_opt_3(void*);
int main(void)
{
return 0;
}
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for bottleneck
Building wheel for lru-dict (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\matti\Zipline\venv-zipline\Scripts\python.exe' -u -c 'import sys, setuptools,
tokenize; sys.argv[0] = '"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install-u0djao1v\\lru-
dict_78af74fc04d748028bedabc5a1d6a84d\\setup.py'"'"';
__file__='"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install-u0djao1v\\lru-
dict_78af74fc04d748028bedabc5a1d6a84d\\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\matti\AppData\Local\Temp\pip-wheel-qiws589m'
cwd: C:\Users\matti\AppData\Local\Temp\pip-install-u0djao1v\lru-
dict_78af74fc04d748028bedabc5a1d6a84d\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'lru' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":
`enter code here`https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for lru-dict
Running setup.py clean for lru-dict
Failed to build bcolz bottleneck lru-dict
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly
From my experience of installing python packages, I think the problem is most likely dependencies and packages already installed in the python environment you are trying to install zipline trader. I suggest creating a new python environment with python version 3.6 and cloning the git and trying to install with that using these two commands:
git clone https://github.com/shlomikushchi/zipline-trader.git
then inside the directory that you downloaded that git:
pip install -e .
I did this in an anaconda environment and it worked for me.
You need this package for cloning git in anaconda:
conda install -c anaconda git
You can check out instructions here too.
My Python version is 2.7.15.
I have tried the pip install MySQL-python command, but it returned the following errors:
PS C:\Users\user\insertTable> pip install MySQL-python
Collecting MySQL-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip-install-mlakyv\\MySQL-python\\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\user\appdata\local\temp\pip-record-08sd4b\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
copying _mysql_exceptions.py -> build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-2.7\MySQLdb
creating build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-2.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
C:\Users\user\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\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 /Fobuild\temp.win-amd64-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:\\Users\\user\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip-install-mlakyv\\MySQL-python\\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\user\appdata\local\temp\pip-record-08sd4b\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in c:\users\user\appdata\local\temp\pip-install-mlakyv\MySQL-python\
You are using pip version 18.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I've only recently began learning Python, so I'm confused on what to do. Can anyone please help?
I'm currently working through a Django tutorial and after trying to install mysqlclient I have had the following error message on my CMD.
Many thanks in advance
Failed building wheel for mysqlclient
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\o\envs\py1\scripts\python.exe -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\O\\AppData\\Local\\T
emp\\pip-install-kej8gk5_\\mysqlclient\\setup.py';f=getattr(tokenize,
'open', op
en)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, _
_file__, 'exec'))" install --record
C:\Users\O\AppData\Local\Temp\pip-reco
rd-_27hw8hl\install-record.txt --single-version-externally-managed --
compile --install-headers
c:\users\o\envs\py1\include\site\python3.7\mysqlclient:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying _mysql_exceptions.py -> build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.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
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
i will recommend use python 64-bit.
This problem occured when mysql is of 64-bit and python is of 32-bit and when we forcefully install mysqlclient via this websitePython Extension Package
Or you can install both of 32-bit
pip install mysqlclient
or use this:pip install --only-binary :all: mysqlclient
Using 64-bit python you can easily install it.
I have been trying to install mysqlclient to communicate with python but i always get this error below. I have tried installing from command prompt too but it says "module setup tools is not found"
can someone tell show me what's wrong? Thanks
I have been trying to install mysqlclient to communicate with python but i always get this error below. I have tried installing from command prompt too but it says "module setup tools is not found"
can someone tell show me what's wrong? Thanks
(venv) C:\Users\kesh\PycharmProjects\SplashSongs>pip3 install mysqlclient
Collecting mysqlclient
Using cached
https://files.pythonhosted.org/packages/ec
/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/
mysqlclient-1.3.13.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command
C:\Users\kesh\PycharmProjects\SplashSongs\venv\Scripts\python.exe -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\kesh\\AppData\\Local\\Temp\\
pip-install-3qsuf31w\\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\kesh\AppData\Local\Temp\pip-record-6eq7cdv9\install-record.txt
--single-version-externally-managed --compile --install-headers \ Users\kesh\PycharmProjects\SplashSongs\venv\include\site\python3.5\mysqlclient:C:\Users\kesh\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py:261:
UserWarning: Unknown distribution option:
'long_description_content_type' warnings.warn(msg)
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\compat.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.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\CLIENT.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\ER.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\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Command "C:\Users\kesh\PycharmProjects\SplashSongs\venv\Scripts\python.exe -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\kesh\\AppData\\Local\\Temp\\pip-install-
3qsuf31w\\msqlclient\\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\kesh\ApData\Local\Temp\pip-
record-6eq7cdv9\install-record.txt --single-version-externally-managed --
compile --install-headers
C:\Users\kesh\PycharmProjects\SplashSongs\venv\include\site\python3.5\my
sqlclient" failed with error code 1 in C:\Users\kesh\AppData\Local\Temp\pip-
install-3qsuf31w\mysqlclient\
(venv) C:\Users\kesh\PycharmProjects\SplashSongs>pip3 install mysqlclient
Collecting mysqlclient
Using cached
https://files.pythonhosted.org/packages/ec
/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/
mysqlclient-1.3.13.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command
C:\Users\kesh\PycharmProjects\SplashSongs\venv\Scripts\python.exe -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\kesh\\AppData\\Local\\Temp\\
pip-install-3qsuf31w\\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\kesh\AppData\Local\Temp\pip-record-6eq7cdv9\install-record.txt
--single-version-externally-managed --compile --install-headers \ Users\kesh\PycharmProjects\SplashSongs\venv\include\site\python3.5\mysqlclient:C:\Users\kesh\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py:261:
UserWarning: Unknown distribution option:
'long_description_content_type' warnings.warn(msg)
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\compat.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.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\CLIENT.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\ER.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\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Command "C:\Users\kesh\PycharmProjects\SplashSongs\venv\Scripts\python.exe -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\kesh\\AppData\\Local\\Temp\\pip-install-
3qsuf31w\\msqlclient\\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\kesh\ApData\Local\Temp\pip-
record-6eq7cdv9\install-record.txt --single-version-externally-managed --
compile --install-headers
C:\Users\kesh\PycharmProjects\SplashSongs\venv\include\site\python3.5\my
sqlclient" failed with error code 1 in C:\Users\kesh\AppData\Local\Temp\pip-
install-3qsuf31w\mysqlclient\
Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient and download a precompiled mysqlclient library for your python version. For an example if you are using python 3.6 32bit version, download
mysqlclient‑1.3.13‑cp36‑cp36m‑win32.whl
Then from either command prompt or pycharm terminal(pycharm terminal if you want to install for the virtual environment of your project) execute
pip install "Path for the downloaded .whl file"
That should install mysqlclient without a problem.
When I tried to install mysql in python
using this command python -m pip install mysql
can anyone help me with this?
Collecting mysql Using cached mysql-0.0.1.tar.gz Collecting
MySQL-python (from mysql) Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python, mysql Running setup.py
install for MySQL-python ... error
Complete output from command C:\Users\vishnuvardhan12137\AppData\Local\Programs\Python\Python36-32\python.exe
-u -c "import setuptools, tokenize;file='C:\Users\VISHNU~1\AppData\Local\Temp\pip-build-lw04ypbu\MySQL-python\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\VISHNU~1\AppData\Local\Temp\pip-0awclynb-record\install-record.txt
--single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
copying _mysql_exceptions.py -> build\lib.win32-3.6
creating build\lib.win32-3.6\MySQLdb
copying MySQLdb__init__.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb
creating build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants__init__.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":
http://landinghub.visualstudio.com/visual-cpp-build-tools
---------------------------------------- Command "C:\Users\vishnuvardhan12137\AppData\Local\Programs\Python\Python36-32\python.exe
-u -c "import setuptools, tokenize;file='C:\Users\VISHNU~1\AppData\Local\Temp\pip-build-lw04ypbu\MySQL-python\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\VISHNU~1\AppData\Local\Temp\pip-0awclynb-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
C:\Users\VISHNU~1\AppData\Local\Temp\pip-build-lw04ypbu\MySQL-python\
It says that it requires Microsoft Visual C++ 14.0. Have you tried installing that version of Microsoft Visual C++? And do take a look at this post too. Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
Go to this website:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
Get your compatible mysqlclient version as per python version and windows version 32/64 bit then run following command
pip install mysqlclient-1.4.2-cp37-cp37m-win32.whl
in my case it was python 3.7 and 32-bit Windows so I downloaded such file mysqlclient-1.4.2-cp37-cp37m-win32.whl