Unable to install mod_wsgi with python 3 on windows 10 - python

I am trying to install mod_wsgi on windows 10 with python 3.7.3. When i run this command pip install mod_wsgi i am getting following error , i have also install Microsoft VC Build Tool 2019 v14.2
Using Windows 10 latest updates, pip latest version , setuptools latest verion . When mod_wsgi starts build then this error is occurring.
(venv) D:\myprojec>pip install mod_wsgi
Collecting mod_wsgi
Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
Building wheels for collected packages: mod-wsgi
Building wheel for mod-wsgi (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'D:\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-d90lfqww\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-d90lfqww\\mod-wsgi\\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\dell\AppData\Local\Temp\pip-wheel-3cghvb62'
cwd: C:\Users\dell\AppData\Local\Temp\pip-install-d90lfqww\mod-wsgi\
Complete output (33 lines):
c:\users\dell\appdata\local\programs\python\python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi
creating build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server
creating build\lib.win-amd64-3.7\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management
creating build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.7\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\docs
creating build\lib.win-amd64-3.7\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.7\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\server
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 -ID:\xampp\apache\bin/include -ID:\venv\include -Ic:\users\dell\appdata\local\programs\python\python37\include -Ic:\users\dell\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.7\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\dell\AppData\Local\Temp\pip-install-d90lfqww\mod-wsgi\src\server\wsgi_apache.h(39): fatal error C1083: Cannot open include file: 'ws2tcpip.h': No such file or directory
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
----------------------------------------
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: 'D:\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-d90lfqww\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-d90lfqww\\mod-wsgi\\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\dell\AppData\Local\Temp\pip-record-73ujk23s\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\venv\include\site\python3.7\mod-wsgi'
cwd: C:\Users\dell\AppData\Local\Temp\pip-install-d90lfqww\mod-wsgi\
Complete output (33 lines):
c:\users\dell\appdata\local\programs\python\python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi
creating build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server
creating build\lib.win-amd64-3.7\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management
creating build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.7\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\docs
creating build\lib.win-amd64-3.7\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.7\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\server
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 -ID:\xampp\apache\bin/include -ID:\venv\include -Ic:\users\dell\appdata\local\programs\python\python37\include -Ic:\users\dell\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.7\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\dell\AppData\Local\Temp\pip-install-d90lfqww\mod-wsgi\src\server\wsgi_apache.h(39): fatal error C1083: Cannot open include file: 'ws2tcpip.h': No such file or directory
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
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-d90lfqww\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-d90lfqww\\mod-wsgi\\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\dell\AppData\Local\Temp\pip-record-73ujk23s\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\venv\include\site\python3.7\mod-wsgi' Check the logs for full command output.

Related

How to fix ERROR while installing WSGI for PYTHON

I can't install WSGI for Python. I have tried lots of things.
I have installed the latest versions of pip, python, apache, setuptools.
I can't understand why WSGI is not installing
I have started learning python a few days ago on my own.
I have watched lots of videos and i've read lots of informations in different forums. But i couldn't solve this problem
Maybe i'm doing something wrong
D:\It\Console2>pip install mod_wsgi
Collecting mod_wsgi
Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
Building wheels for collected packages: mod-wsgi
Building wheel for mod-wsgi (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'd:\it\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-ih8ke_\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-wsgi\\setup.py'"'"';f=getattr(tokeniz '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheeld 'C:\Users\TheFlash\AppData\Local\Temp\pip-wheel-xh383iwl'
cwd: C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\
Complete output (33 lines):
d:\it\python\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi
creating build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server
creating build\lib.win-amd64-3.6\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management
creating build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.6\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\docs
creating build\lib.win-amd64-3.6\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.6\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\server
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 -IDIt\Apache/include -Id:\it\python\include -Id:\it\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.286\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" "-I\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 (6)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.6\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\src\server\wsgi_apache.h(42): fatal error C1083: ?? г¤ ?вбп RвЄалвм д c< ўЄ<оз?-Ё?:
tpd.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed witexit 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: 'd:\it\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-instal55ih8ke_\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-wsgi\\setup.py'"'"';f=getattr(tokene, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install -ecord 'C:\Users\TheFlash\AppData\Local\Temp\pip-record-vqudmtwm\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\ipython\Include\mod-wsgi'
cwd: C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\
Complete output (33 lines):
d:\it\python\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi
creating build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server
creating build\lib.win-amd64-3.6\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management
creating build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.6\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\docs
creating build\lib.win-amd64-3.6\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.6\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\server
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 -:\It\Apache/include -Id:\it\python\include -Id:\it\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.210\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" "C:\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 Filesx86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.6\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\src\server\wsgi_apache.h(42): fatal error C1083: ?? г¤ ?вбп RвЄалвм д c< ўЄ<оз?-Ё?httpd.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed wh exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\it\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TheFlash\ppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-ws\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __fi__, '"'"'exec'"'"'))' install --record 'C:\Users\TheFlash\AppData\Local\Temp\pip-record-vqudmtwm\install-record.txt' --single-version-externally-managed
compile --install-headers 'd:\it\python\Include\mod-wsgi' Check the logs for full command output.
EDIT:
You might be able to find your solution from this answer
Here are steps that I took:
Install python x64 (may need to double check you downloaded the right one for your OS)
Install pip
Install Apache
Moved the extracted Apache24 folder to C:\
Set the env variable for apache with set "MOD_WSGI_APACHE_ROOTDIR=C:\Apache24"
Install Microsoft C++ build tools
Restart machine
Run pip install mod_wsgi

Getting errors while installing mysql-python for flask

I am using python v3.7. I want to install mysql-python for flask application. I got ModuleNotFoundError: No module named 'MySQLdb', and searched on internet where I found that this can be solved by installing either mysql-python or mysqlclient.
But, when I tried to install mysql-python using command pip install mysql-python and got following errors. Please help to resolve them. Thank you.
Defaulting to user installation because normal site-packages is not writeable
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip (108 kB)
Building wheels for collected packages: mysql-python
Building wheel for mysql-python (setup.py): started
Building wheel for mysql-python (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Anshu\\AppData\\Local\\Temp\\pip-install-hx2vj4vu\\mysql-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Anshu\\AppData\\Local\\Temp\\pip-install-hx2vj4vu\\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\Anshu\AppData\Local\Temp\pip-wheel-rqv0mwcp'
cwd: C:\Users\Anshu\AppData\Local\Temp\pip-install-hx2vj4vu\mysql-python\
Complete output (29 lines):
running bdist_wheel
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\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.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\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.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
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -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:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tc_mysql.c /Fobuild\temp.win32-3.7\Release\_mysql.obj /Zl
_mysql.c
c:\program files (x86)\python37-32\include\pyconfig.h(203): fatal error C1083: Cannot open include file: 'basetsd.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 mysql-python
Running setup.py clean for mysql-python
Failed to build mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python: started
Running setup.py install for mysql-python: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Anshu\\AppData\\Local\\Temp\\pip-install-hx2vj4vu\\mysql-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Anshu\\AppData\\Local\\Temp\\pip-install-hx2vj4vu\\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\Anshu\AppData\Local\Temp\pip-record-q9lznfeo\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Anshu\AppData\Roaming\Python\Python37\Include\mysql-python'
cwd: C:\Users\Anshu\AppData\Local\Temp\pip-install-hx2vj4vu\mysql-python\
Complete output (29 lines):
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\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.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\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.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
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -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:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tc_mysql.c /Fobuild\temp.win32-3.7\Release\_mysql.obj /Zl
_mysql.c
c:\program files (x86)\python37-32\include\pyconfig.h(203): fatal error C1083: Cannot open include file: 'basetsd.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)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Anshu\\AppData\\Local\\Temp\\pip-install-hx2vj4vu\\mysql-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Anshu\\AppData\\Local\\Temp\\pip-install-hx2vj4vu\\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\Anshu\AppData\Local\Temp\pip-record-q9lznfeo\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Anshu\AppData\Roaming\Python\Python37\Include\mysql-python' Check the logs for full command output.
Sometimes people face same error with visual C++ tools, launch setup again and also select windows 8.1 / 10 SDK depending upon your OS. This will fix basestd.h error.
If it is still not working, try launching build tools from: C:\Program Files (x86)\Microsoft Visual C++ Build Tools.
Another alternative would be, just install anaconda 2 or 3 (64 bit if also you don't want memory errors). It contains all the important packages prebuilt: sklearn, matplotlib, scipy, numpy, pandas and even web development frameworks such as flask.
i hope this helps <3

Errors while installing mod_wsgi in python?

I was trying to install mod_wsgi , so i installed its prerequisites .
Python (3.7.4)
Microsoft Visual C++ Build tool (2015) Microsoft
Visual C++ 2015-2019 Redistributable (14.23.27820)
Xampp (for Apache 2.4)
But the on doing pip install mod_wsgi i got following errors
C:\Windows\system32>pip install mod_wsgi
Collecting mod_wsgi
Using cached https://files.pythonhosted.org/packages/26/03/a3ed5abc2e66c82c40b
0735c2f819c898d136879b00be4f5537126b6a4a4/mod_wsgi-4.6.7.tar.gz
Installing collected packages: mod-wsgi
Running setup.py install for mod-wsgi ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\taha.tauqir\appdata\local\programs\python\python37-32\py
thon.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\
\TAHA~1.TAU\\AppData\\Local\\Temp\\pip-install-_zkqbo33\\mod-wsgi\\setup.py'"'"'
; __file__='"'"'C:\\Users\\TAHA~1.TAU\\AppData\\Local\\Temp\\pip-install-_zkqbo3
3\\mod-wsgi\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);c
ode=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__, '"'"'exec'"'"'))' install --record 'C:\Users\TAHA~1.TAU\AppData\Local\
Temp\pip-record-4uoq0nq8\install-record.txt' --single-version-externally-managed
--compile
cwd: C:\Users\TAHA~1.TAU\AppData\Local\Temp\pip-install-_zkqbo33\mod-ws
gi\
Complete output (33 lines):
c:\users\taha.tauqir\appdata\local\programs\python\python37-32\lib\distutils
\dist.py:274: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\mod_wsgi
copying src\__init__.py -> build\lib.win32-3.7\mod_wsgi
creating build\lib.win32-3.7\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win32-3.7\mod_wsgi\server
copying src\server\environ.py -> build\lib.win32-3.7\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win32-3.7\mod_wsgi\server
creating build\lib.win32-3.7\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win32-3.7\mod_wsgi\se
rver\management
creating build\lib.win32-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win32-3.7\
mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win32-3.7\mo
d_wsgi\server\management\commands
creating build\lib.win32-3.7\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win32-3.7\mod_wsgi\docs
creating build\lib.win32-3.7\mod_wsgi\images
copying images\__init__.py -> build\lib.win32-3.7\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win32-3.7\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
creating build\temp.win32-3.7\Release\src\server
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo
/Ox /W3 /GL /DNDEBUG /MD -IC:\xampp\apache/include -Ic:\users\taha.tauqir\appda
ta\local\programs\python\python37-32\include -Ic:\users\taha.tauqir\appdata\loca
l\programs\python\python37-32\include /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win
32-3.7\Release\src/server\mod_wsgi.obj
mod_wsgi.c
c:\users\taha.tauqir\appdata\local\temp\pip-install-_zkqbo33\mod-wsgi\src\se
rver\wsgi_apache.h(39): fatal error C1083: Cannot open include file: 'ws2tcpip.h
': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\b
in\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\taha.tauqir\appdata\loc
al\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokeni
ze; sys.argv[0] = '"'"'C:\\Users\\TAHA~1.TAU\\AppData\\Local\\Temp\\pip-install-
_zkqbo33\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TAHA~1.TAU\\AppData\
\Local\\Temp\\pip-install-_zkqbo33\\mod-wsgi\\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\TAHA~1.TAU\AppData\Local\Temp\pip-record-4uoq0nq8\install-record.txt' --
single-version-externally-managed --compile Check the logs for full command outp
ut.

VSCode, why do i get error while trying to install mysqlclient to django project

I'm trying to get my mysql integration to django project however when i try to pip install mysqlclient
VSCode throws this error:
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\popcorn\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\popcorn\\AppData\\Local\\Temp\\pip-install-yefz5w6i\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\popcorn\\AppData\\Local\\Temp\\pip-install-yefz5w6i\\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\popcorn\AppData\Local\Temp\pip-record-f55ih7zv\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\popcorn\AppData\Local\Temp\pip-install-yefz5w6i\mysqlclient\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -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:\users\popcorn\appdata\local\programs\python\python37-32\include -Ic:\users\popcorn\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-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\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\popcorn\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\popcorn\\AppData\\Local\\Temp\\pip-install-yefz5w6i\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\popcorn\\AppData\\Local\\Temp\\pip-install-yefz5w6i\\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\popcorn\AppData\Local\Temp\pip-record-f55ih7zv\install-record.txt' --single-version-externally-managed --compile Check the
logs for full command output.
Anyone know how can i fix this? I've already installed Microsoft Visual C++ pack version 14.22.
The latest release of mysqlclient has wheels for Windows, but they are for 64-bit. If you're on a 64-bit install of Windows I would solve this by installing a 64-bit build of Python. Otherwise it seems to be a bug in the sdist where a header file was accidentally left out.

What is this error whenever I try to install mysql for python module?

I have tried 2 commands:
pip install mysql-python
and
pip install mysqlclient
Error for the pip install mysql-python
Command "C:\Users\Pops\Desktop\Martin\Programming\Python\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Pops\\AppData\\Local\\Temp\\pip-install-zfndvw17\\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\Pops\AppData\Local\Temp\pip-reco
rd-jpu7d9zb\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Pops\Desktop\Martin\Programming\Python\venv\include\site\python3.7\mysql-python" failed with er
ror code 1 in C:\Users\Pops\AppData\Local\Temp\pip-install-zfndvw17\mysql-python\
Error for the pip install mysqlclient
Command "C:\Users\Pops\Desktop\Martin\Programming\Python\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Pops\\AppData\\Local\\Temp\\pip-install-cn_nm0np\\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\Pops\AppData\Local\Temp\pip-recor
d-lyzr49kh\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Pops\Desktop\Martin\Programming\Python\venv\include\site\python3.7\mysqlclient" failed with erro
r code 1 in C:\Users\Pops\AppData\Local\Temp\pip-install-cn_nm0np\mysqlclient\
This is the download portion and seems to work fine until the end. (Just putting this here to fill-up more non-code text for stackoverflow to accept the revision)
Top portion prior to error:
Collecting mysqlclient
Downloading https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz (90kB)
100% |████████████████████████████████| 92kB 168kB/s
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command C:\Users\Pops\Desktop\Martin\Programming\Python\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Pops\\AppData\\Local\\Temp\\pip-instal
l-cn_nm0np\\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\Pops\AppD
ata\Local\Temp\pip-record-lyzr49kh\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Pops\Desktop\Martin\Programming\Python\venv\include\site\python3.7\mysql
client:
C:\Users\Pops\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
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
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -IC:\Users\Pops\Desktop\Martin\Pro
gramming\Python\venv\include -IC:\Users\Pops\AppData\Local\Programs\Python\Python37-32\include -IC:\Users\Pops\AppData\Local\Programs\Python\Python37-32\include "-IC:\Program Files (x86)\Windows Kits
\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Win
dows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tc_mysql.c /Fobuild\temp.win32-3.7\Release\_mysql.obj /Zl
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
You have to add cl.exe into your PATH. It is generally located in (visual studio folder)\VC\bin directory. Add that to your PATH variable using the steps in here.
After this restart the command prompt and you can use cl.exe from command prompt.
Alternatively you can download unofficial windows binaries for mysqlclient from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient. And Install using pip install "path to the downloaded whl file"
As I mentioned in the comment, you need to cl.exe folder.
You can do it through Visual Studio installer.
Install the following C++ compilers:

Categories

Resources