How can I install Zipline-trader without errors - python

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.

Related

Scrapy install fail - error of exit status 1

copying src\twisted\test\key.pem.no_trailing_newline -> build\lib.win32-3.8\twisted\test
copying src\twisted\test\server.pem -> build\lib.win32-3.8\twisted\test
copying src\twisted\test\test_defer.py.3only -> build\lib.win32-3.8\twisted\test
copying src\twisted\internet\iocpreactor\notes.txt -> build\lib.win32-3.8\twisted\internet\iocpreactor
copying src\twisted\internet\test\_awaittests.py.3only -> build\lib.win32-3.8\twisted\internet\test
copying src\twisted\internet\test\_yieldfromtests.py.3only -> build\lib.win32-3.8\twisted\internet\test
creating build\lib.win32-3.8\twisted\internet\test\fake_CAs
copying src\twisted\internet\test\fake_CAs\chain.pem -> build\lib.win32-3.8\twisted\internet\test\fake_CAs
copying src\twisted\internet\test\fake_CAs\not-a-certificate -> build\lib.win32-3.8\twisted\internet\test\fake_CAs
copying src\twisted\internet\test\fake_CAs\thing1.pem -> build\lib.win32-3.8\twisted\internet\test\fake_CAs
copying src\twisted\internet\test\fake_CAs\thing2-duplicate.pem -> build\lib.win32-3.8\twisted\internet\test\fake_CAs
copying src\twisted\internet\test\fake_CAs\thing2.pem -> build\lib.win32-3.8\twisted\internet\test\fake_CAs
copying src\twisted\mail\test\rfc822.message -> build\lib.win32-3.8\twisted\mail\test
copying src\twisted\python\test\_deprecatetests.py.3only -> build\lib.win32-3.8\twisted\python\test
copying src\twisted\trial\test\_assertiontests.py.3only -> build\lib.win32-3.8\twisted\trial\test
copying src\twisted\words\im\instancemessenger.glade -> build\lib.win32-3.8\twisted\words\im
copying src\twisted\words\xish\xpathparser.g -> build\lib.win32-3.8\twisted\words\xish
running build_ext
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
I totally new to python and scrapy. I've been using python ok for a few days now and wanted to add scrapy. I tried to install scrapy via the command prompt, typing in "pip install scrapy". it downloaded something, started installing but soon exited in failure. below are the last lines of a massive error log;
ERROR: Command errored out with exit status 1: 'c:\users\thega\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\thega\AppData\Local\Temp\pip-install-o99u8knn\Twisted\setup.py'"'"'; file='"'"'C:\Users\thega\AppData\Local\Temp\pip-install-o99u8knn\Twisted\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\thega\AppData\Local\Temp\pip-record-b2nn016h\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Have you installed Microsoft Visual C++ 14.0?
The last line in the error log says:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/"
The link works fine for me.

Microsoft Visual C++ 14.0 is required - installing mysqldb for python

I am trying, in Windows 10, to install using pip MySQL-python as seen below. I am being told I need Microsoft Visual C++ 14 but I have installed Microsoft Visual Studio 11, 12, and 2017. 2017 should be providing me the required components if my research is accurate. I, also, installed Microsoft Build Tools. I am at a loss what is wrong. I am trying to migrate from my Ubuntu VM to native Windows with PyCharm. I have seen lots of other questions but none seem to have the answer I need.
C:\Environment\Python27>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:\users\efultz\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\efultz\\AppData\\Local\\Temp\\pip-build-3d7yo7lf\\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\efultz\AppData\Local\Temp\pip-wcici6ff-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying _mysql_exceptions.py -> build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-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": https://visualstudio.microsoft.com/downloads/
I never figured out the problem but I believe it was related to having both Python2 and Python3 installed on my machine. I uninstalled Python3 and was able, with a little more effort, to get things working. Hopefully when we do our migration to Python3 I won't return to having this problem.
If you want to install database i would go to Microsoft webpage (https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html) and install it from there.
As far as i know, you can't install database via python's pip.

pip install myclient error - on Windows 7 using Python 3.7.0

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.

python mysql installation failed

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

pip Install error for mysql-python not working

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"

Categories