Failed with pip install chompack - python

I'm trying to install chompack with pip to use in a Support Vector Machine algorithm with cvxopt. However it gives me an error for which I haven't found a clear answer. There is a related question but the answer provided is very specific to the package the person is trying to install. In my case, there's no binary package that I can download or even a .whl file.
The specific error seems to be
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2
Here's what I typed in the command prompt (Windows 10 PC) and the full result.
pip install chompack
I get
Collecting chompack
Using cached chompack-2.2.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): cvxopt>=1.1.7 in c:\python27\lib\site-packages (from chompack)
Building wheels for collected packages: chompack
Running setup.py bdist_wheel for chompack ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\my_username\\appdata\\local\\temp\\pip-build-o8y8d4\\chompack\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d c:\users\my_username\appdata\local\temp\tmpv64_u4pip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --python-tag not recognized
----------------------------------------
Failed building wheel for chompack
Running setup.py clean for chompack
Failed to build chompack
Installing collected packages: chompack
Running setup.py install for chompack ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\my_username\\appdata\\local\\temp\\pip-build-o8y8d4\\chompack\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\my_username\appdata\local\temp\pip-fkqebc-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\chompack
copying src\python\base.py -> build\lib.win32-2.7\chompack
copying src\python\conversion.py -> build\lib.win32-2.7\chompack
copying src\python\maxchord.py -> build\lib.win32-2.7\chompack
copying src\python\mcs.py -> build\lib.win32-2.7\chompack
copying src\python\misc.py -> build\lib.win32-2.7\chompack
copying src\python\pfcholesky.py -> build\lib.win32-2.7\chompack
copying src\python\symbolic.py -> build\lib.win32-2.7\chompack
copying src\python\__init__.py -> build\lib.win32-2.7\chompack
creating build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\cholesky.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\completion.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\edmcompletion.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\hessian.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\llt.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\plot.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\projected_inverse.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\psdcompletion.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\trmm.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\trsm.py -> build\lib.win32-2.7\chompack\pybase
copying src\python\pybase\__init__.py -> build\lib.win32-2.7\chompack\pybase
running build_ext
building 'cbase' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\src
creating build\temp.win32-2.7\Release\src\C
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\python27\include -Ic:\python27\PC /Tcsrc/C\cbase.c /Fobuild\temp.win32-2.7\Release\src/C\cbase.obj
cbase.c
c:\users\my_username\appdata\local\temp\pip-build-o8y8d4\chompack\src\c\cvxopt.h(31) : fatal error C1083: Cannot open include file: 'complex.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\my_username\\appdata\\local\\temp\\pip-build-o8y8d4\\chompack\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\my_username\appdata\local\temp\pip-fkqebc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\my_username\appdata\local\temp\pip-build-o8y8d4\chompack

I do not know the precise reason but you should use python itself to install packages as chompack:
python -m pip install chompack
For further informations read the manual: https://docs.python.org/3/installing/
PS: I have seen the same message but it installed it anyway.

Related

How To solve "Error C1083" when Install mod_wsgi in windows? file 'ws2tcpip.h'

I try to install mod_wsgi for windows I install the diferentes requirements about C and C++, and this other stuff, about Visual Studio etc..
But I got this error:
ERROR: Command errored out with exit status 1:
command:
'Z:\PROGRAMACION\6_BACKEND\envpy\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize;
sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-req-build-jdxut7hw\\setup.py'"'"';
__file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-req-build-jdxut7hw\\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\Public\Documents\Wondershare\CreatorTemp\pip-wheel-7xzm29_v'
cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-build-jdxut7hw\
Complete output (31 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi
creating build\lib.win-amd64-3.8\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.8\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.8\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\server
creating build\lib.win-amd64-3.8\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\server\management
creating build\lib.win-amd64-3.8\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.8\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.8\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\docs
creating build\lib.win-amd64-3.8\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.8\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
creating build\temp.win-amd64-3.8\Release\src\server
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\Apache24/include -IZ:\PROGRAMACION\6_BACKEND\envpy\include -Ic:\users\andres\appdata\local\programs\python\python38\include -Ic:\users\andres\appdata\local\programs\python\python38\include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include" "
-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.8\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-build-jdxut7hw\src\server\wsgi_apache.h(39):
fatal error C1083: No se puede abrir el archivo incluir: 'ws2tcpip.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for mod-wsgi
Running setup.py clean for mod-wsgi
Failed to build mod-wsgi
Installing collected packages: mod-wsgi
Running setup.py install for mod-wsgi ... error
ERROR: Command errored out with exit status 1:
command: 'Z:\PROGRAMACION\6_BACKEND\envpy\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-req-build-jdxut7hw\\setup.py'"'"'; __file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-req-build-jdxut7hw\\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\Public\Documents\Wondershare\CreatorTemp\pip-record-10zpln53\install-record.txt' --single-version-externally-managed --compile --install-headers 'Z:\PROGRAMACION\6_BACKEND\envpy\include\site\python3.8\mod-wsgi'
cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-build-jdxut7hw\
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi
creating build\lib.win-amd64-3.8\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.8\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.8\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\server
creating build\lib.win-amd64-3.8\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\server\management
creating build\lib.win-amd64-3.8\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.8\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.8\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\docs
creating build\lib.win-amd64-3.8\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.8\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.8\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
creating build\temp.win-amd64-3.8\Release\src\server
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\Apache24/include -IZ:\PROGRAMACION\6_BACKEND\envpy\include -Ic:\users\andres\appdata\local\programs\python\python38\include -Ic:\users\andres\appdata\local\programs\python\python38\include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.8\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-build-jdxut7hw\src\server\wsgi_apache.h(39): fatal error C1083: No se puede abrir el archivo incluir: 'ws2tcpip.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'Z:\PROGRAMACION\6_BACKEND\envpy\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-req-build-jdxut7hw\\setup.py'"'"';
__file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-req-build-jdxut7hw\\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\Public\Documents\Wondershare\CreatorTemp\pip-record-10zpln53\install-record.txt' --single-version-externally-managed --compile --install-headers 'Z:\PROGRAMACION\6_BACKEND\envpy\include\site\python3.8\mod-wsgi' Check the logs for full command output.
My Specific error:
fatal error C1083: Cannot open file include: 'ws2tcpip.h': No such file or directory
'ws2tcpip.h' my file is diferent
I See:
Testing installation of mod_wsgi on Windows. for the Graham Dumpleton the creator of this module.
I search here And I got Similar errors but diferentes library
for example Error atemp install connector of MySQL: fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
But In diferents answere in stack overflow sugest that you can donwload a file with extension whl then I went at this page Unofficial Windows Binaries for Python Extension Packages and I dowload mod_wsgi-4.9.0-cp38-cp38-win_amd64.whl
I then I put this strange file in folder of virtual enviroment site-packages
Then I try with the virtual env activate:
pip install "$ .\envpy\Lib\site-packages\mod_wsgi-4.9.0-cp38-cp38-win_amd64.whl"
In my case the full path is:
pip install "Z:\PROGRAMACION\6_BACKEND\envpy\Lib\site-packages\mod_wsgi-4.9.0-cp38-cp38-win_amd64.whl"
And the installation was well. The output in the cmd was the installation was well and If I entry in
cd Z:\PROGRAMACION\6_BACKEND\envpy\Lib\site-packages\
I can see the folder \mod_wsgi\
but I am no sure if this installation will be funtional. I don't know if the installation with pip, instal other stuff, other files for example in apache folder like apache\include or in apache\modules
Y see this blog too Error C1083 al compilar extensiones con Visual Studio 2015
But I don't know in which part of the script setup.py I needed to changue

How to fix the error coming pip install MySQL-python

C:\Windows\system32>pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
Using legacy setup.py install for MySQL-python, since package 'wheel' is not installed.
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Pavan P\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\MySQL-python\setup.py'"'"'; file='"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\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\Pavan P\AppData\Local\Temp\pip-record-lt8udbbu\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Pavan P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\MySQL-python'
cwd: C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\MySQL-python
Complete output (24 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying mysql_exceptions.py -> build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\MySQLdb
copying MySQLdb_init.py -> build\lib.win-amd64-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.8\MySQLdb
creating build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants_init_.py -> build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.8\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Pavan P\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\MySQL-python\setup.py'"'"'; file='"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\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\Pavan P\AppData\Local\Temp\pip-record-lt8udbbu\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Pavan P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\MySQL-python' Check the logs for full command output.
you do not need to install visual studio build tools, instead, try installing the following modules which are all the same ones,
pip install pymysql
pip install mysql-connector
pip install mysql-connector-python
Note:
all the modules listed here are the same thing
Here is the error, looks like you need to install MS visual C++ 14.0
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools
for Visual Studio": https://visualstudio.microsoft.com/downloads/
---------------------------------------- ERROR: Command errored out with exit status 1
The fastest and best way you solve your issues is modules whl.
python -m pip install mysqlclient==1.4.2.post1

Python pip install mysqlclient

So I downloaded Python 32 bits 1st, then I did
python -m pip install mysqlclient.
I needed Visual C++ 2015, but I had them cuz my text editors is VSCode.
I uninstalled VSCode, installed Visual Studio Build Tools, and I am getting this errors whenever I do python -m pip install mysqlclient.One, cl.exe wasnt added to my path, so I did, but it still says
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
so I downloaded the wheel package for windows, as some other stackoverflow answer said. Whenever I run it, I get
I tried downloading Python 64 bits downloading the wheels, adding cl.exe to path.
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\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\Patrik\AppData\Local\Temp\pip-wheel-o3ba369p' --python-tag cp37
cwd: C:\Users\Patrik\AppData\Local\Temp\pip-install-0vmm7fdx\mysqlclient\
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating 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\_exceptions.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.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\CLIENT.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\ER.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\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" "-IC:\Program Files (x86)\Python\include" "-IC:\Program Files (x86)\Python\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\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\Patrik\AppData\Local\Temp\pip-record-nk0ejlkz\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Patrik\AppData\Local\Temp\pip-install-0vmm7fdx\mysqlclient\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating 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\_exceptions.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.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\CLIENT.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\ER.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\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" "-IC:\Program Files (x86)\Python\include" "-IC:\Program Files (x86)\Python\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\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\Patrik\AppData\Local\Temp\pip-record-nk0ejlkz\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
It should just work and the package mysqlclient just be installed using pip so I can use it with django.
There isn't an official wheel for the current release 1.4.4, and you are getting errors when you try to install from source.
Since you use 64-bit Python on Windows, you could install 1.4.2.post1, because there is an official wheel for that version.
python -m pip install mysqlclient==1.4.2.post1
Or, you could download an unofficial wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient, which has wheels for the latest release for 32-bit and 64-bit Python on Windows. Unless you have a particular reason to use 32-bit Python, I suggest you use 64-bit.
For example, you could download mysqlclient‑1.4.4‑cp37‑cp37m‑win_amd64.whl (Python 3.7 64-bit for Windows) then do:
python -m pip install mysqlclient‑1.4.4‑cp37‑cp37m‑win_amd64.whl
I had a similar situation, and i did this:
sudo apt-get install python3-dev libmysqlclient-dev
afterward, inside a virtual environment:
pip3 install mysqlclient
and that was because, i had another problem with the instalation of:
pip3 install flask-mysqldb
You can use pymysql instead of mysqlclient
Install pymysql
pip install pymysql
Modify your init.py file
import pymysql
pymysql.install_as_MySQLdb()
You can start your project
FWIW: I also faced this problem on a macOS, with the error:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'xcrun' failed with exit status 1
A solution (borrowed from this related post) that worked for me was to fix the brew-installed openssl linking:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

pygraphviz installation failed when building 'pygraphviz._graphviz' extension

I'm trying to install pygraphviz on Win7, python 3.5
Using following command:
C:\Users\...>C:\Python35\python.exe -m pip install pygraphviz
Also tried to add install options, but it didn't help:
--install-option="--library-path=C:\Program Files (x86)\Graphviz\graphviz-2.38\release\lib\debug\lib" --install-option="--include-path=C:\Program Files (x86)\Graphviz\graphviz-2.38\release\include"
And here is the return:
no previously-included directories found matching 'doc\build'
writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
copying pygraphviz\graphviz.i -> build\lib.win-amd64-3.5\pygraphviz
copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.5\pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Command "C:\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\ebarhab\\AppData\\Local\\Temp\\pip-build-iot7onp2\\pygraphviz\\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\ebar
hab\AppData\Local\Temp\pip-hrnu16e0-record\install-record.txt --single-version-e
xternally-managed --compile "--library-path=C:\Program Files (x86)\Graphviz\grap
hviz-2.38\release\lib\debug\lib" "--include-path=C:\Program Files (x86)\Graphviz
\graphviz-2.38\release\include"" failed with error code 1 in C:\Users\ebarhab\Ap
pData\Local\Temp\pip-build-iot7onp2\pygraphviz\
Could you help me solve this issue?
Thanks,
Bartek

Error while trying to install MySQL onto Python3.4

I've run following command in command line. Please see the execution and error at the end of the code:
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio
10.0\VC\BIN\cl .exe' failed with exit status 2
D:\Python34>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
Complete output from command D:\Python34\python.exe -c "import setuptools, t
okenize;__file__='C:\\Users\\Irfan\\AppData\\Local\\Temp\\pip-build-i5dqkio1\\My
SQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Irfan\A
ppData\Local\Temp\pip-v08vge52-record\install-record.txt --single-version-extern
ally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.4
copying _mysql_exceptions.py -> build\lib.win32-3.4
creating build\lib.win32-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb
creating build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constan
ts
copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\const
ants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constant
s
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.4
creating build\temp.win32-3.4\Release
C:\Program Files\Microsoft Visual Studio 10.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" -ID:\Python34\include
-ID:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.obj /Z
l
_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\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl
.exe' failed with exit status 2
----------------------------------------
Command "D:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:
\\Users\\Irfan\\AppData\\Local\\Temp\\pip-build-i5dqkio1\\MySQL-python\\setup.py
';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --record C:\Users\Irfan\AppData\Local\Temp\pi
p-v08vge52-record\install-record.txt --single-version-externally-managed --compi
le" failed with error code 1 in C:\Users\Irfan\AppData\Local\Temp\pip-build-i5dq
kio1\MySQL-python
MySQL-Python is not compatible with Python 3.4. Please use mysqlclient https://pypi.python.org/pypi/mysqlclient

Categories