error while building mysqlclient on windows - python

everyone ! I am facing the below issue when I ran the command : python setup.py build inside the mysqlclient directory. I have installed mysqlclient 1.3.7
Do you have any solution to fix this ? I am trying to setup MySQL with django.
C:\Users\Hp\Downloads\Compressed\mysqlclient-1.3.7\mysqlclient-1.3.7>python setu
p.py build
running build
running build_py
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
running build_ext
building '_mysql' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -Dversion_info=(1,3,7,'final',1) -D__version__=1.3.7 "-IC
:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -IC:\Python34\include
-IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.obj /Z
l
_mysql.c
_mysql.c(29) : fatal error C1083: Cannot open include file: 'my_config.h': No su
ch file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\
cl.exe' failed with exit status 2
C:\Users\Hp\Downloads\Compressed\mysqlclient-1.3.7\mysqlclient-1.3.7>python setu
p.py install
running install
running bdist_egg
running egg_info
writing top-level names to mysqlclient.egg-info\top_level.txt
writing dependency_links to mysqlclient.egg-info\dependency_links.txt
writing mysqlclient.egg-info\PKG-INFO
reading manifest file 'mysqlclient.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mysqlclient.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
running build_ext
building '_mysql' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -Dversion_info=(1,3,7,'final',1) -D__version__=1.3.7 "-IC
:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -IC:\Python34\include
-IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.obj /Z
l
_mysql.c
_mysql.c(29) : fatal error C1083: Cannot open include file: 'my_config.h': No su
ch file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\
cl.exe' failed with exit status 2

Try to install it via pip
pip install mysqlclient
If you want to build it from source you need to get mysql source as well. Follow this link to find proper source to download.

Related

error: subprocess-exited-with-error | I have an error trying to install pysqlite3 with pip

I've been trying to install pysqlite via pip, but I get this error using the console command: pip install pysqlite3:
Collecting pysqlite3
Using cached pysqlite3-0.5.0.tar.gz (40 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pysqlite3
Building wheel for pysqlite3 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\dbapi2.py -> build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\__init__.py -> build\lib.win-amd64-cpython-311\pysqlite3
running build_ext
Builds a C extension linking against libsqlite3 library
building 'pysqlite3._sqlite3' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\src
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMODULE_NAME=\"pysqlite3.dbapi2\" -I/usr/include "-IC:\Users\USUARIO\Documents\VSCode Projects\env\include" -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\include -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\blob.c /Fobuild\temp.win-amd64-cpython-311\Release\src\blob.obj
blob.c
C:\Users\USUARIO\AppData\Local\Temp\pip-install-repsnu9p\pysqlite3_2227e0dab76349b680a8874662134523\src\blob.h(4): fatal error C1083: No se puede abrir el archivo incluir: 'sqlite3.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pysqlite3
Running setup.py clean for pysqlite3
Failed to build pysqlite3
Installing collected packages: pysqlite3
Running setup.py install for pysqlite3 ... error
error: subprocess-exited-with-error
× Running setup.py install for pysqlite3 did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running install
C:\Users\USUARIO\Documents\VSCode Projects\env\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\dbapi2.py -> build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\__init__.py -> build\lib.win-amd64-cpython-311\pysqlite3
running build_ext
Builds a C extension linking against libsqlite3 library
building 'pysqlite3._sqlite3' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\src
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMODULE_NAME=\"pysqlite3.dbapi2\" -I/usr/include "-IC:\Users\USUARIO\Documents\VSCode Projects\env\include" -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\include -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\blob.c /Fobuild\temp.win-amd64-cpython-311\Release\src\blob.obj
blob.c
C:\Users\USUARIO\AppData\Local\Temp\pip-install-repsnu9p\pysqlite3_2227e0dab76349b680a8874662134523\src\blob.h(4): fatal error C1083: No se puede abrir el archivo incluir: 'sqlite3.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pysqlite3
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I need to implement pysqlite3 in python, but there seem to be various bugs which I don't understand. I also tried to install everything in a virtual environment (virtualenv) because I thought it might be an incompatibility of one of the packages I already have (like Flask, numpy, ect), but I keep getting the same error.
I also tried to install some specific version of pysqlite3 using pip install pysqlite3=={version}, but none of this has worked, the error remains the same.
I have tried updating pip, wheel and setuptools, but the error persists. Does anyone know how to fix it and be able to install pysqlite3?

Cannot open include file: 'io.h': No such file or directory, Python 3.7.5, Windows 8.1, VS v 2019

I am trying to install the Isotree package from pip install, when I receive the error below. I am using Python 3.7, working on a Windows 8 with installed C++ build tools using Visual studio build tools 2019 (version 16.7.5). I have also included Windows 10 SDK (10.0.18362.0) along with other add-ons.
I have tried all possible solutions I found to similar problems on this website and via other google searches, but I can't seem to get it working. Since I am working on a work laptop, I cannot go around and download from another party.
Can somebody help me how to resolve this problem? I tried setting an environment variable INCLUDE, pointing to the folder [C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt]
this helped but another error occurred, "cannot open include: basetsd.h" and then trying to solve that, the original error (io.h) came back.
Building wheel for isotree (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\a481838\appdata\local\programs\python\python37\python.exe'
'c:\users\a481838\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\pep517\_in_process.py' build_wheel 'C:\Users\A481838\AppData\Local\Temp\
tmpslnm97j9'
cwd: C:\Users\A481838\AppData\Local\Temp\pip-install-uxt3l0k4\isotree
Complete output (28 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\isotree
copying isotree\__init__.py -> build\lib.win-amd64-3.7\isotree
running build_ext
cythoning isotree/cpp_interface.pyx to isotree\cpp_interface.cpp
building 'isotree._cpp_interface' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\isotree
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\1
4.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D_USE_MER
SENNE_TWISTER -D_ENABLE_CEREAL -IC:\Users\A481838\AppData\Local\Temp\pip-build-e
nv-7aj7e0rh\overlay\Lib\site-packages\numpy\core\include -I. -I./src -IC:\Users\
A481838\AppData\Local\Temp\pip-build-env-7aj7e0rh\overlay\include -Ic:\users\a48
1838\appdata\local\programs\python\python37\include -Ic:\users\a481838\appdata\l
ocal\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual
Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (
x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include"
"-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" /EHsc /Tpis
otree\cpp_interface.cpp /Fobuild\temp.win-amd64-3.7\Release\isotree\cpp_interfac
e.obj /openmp /O2 /std:c++14
cpp_interface.cpp
c:\users\a481838\appdata\local\programs\python\python37\include\pyconfig.h(59)
: fatal error C1083: Cannot open include file: 'io.h': No such file or directory
c:\users\a481838\appdata\local\programs\python\python37\lib\distutils\extensio
n.py:131: UserWarning: Unknown Extension options: 'install_requires'
warnings.warn(msg)
C:\Users\A481838\AppData\Local\Temp\pip-build-env-7aj7e0rh\overlay\Lib\site-pa
ckages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_le
vel' not set, using 2 for now (Py2). This will change in a later release! File:
C:\Users\A481838\AppData\Local\Temp\pip-install-uxt3l0k4\isotree\isotree\cpp_int
erface.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
warning: isotree\cpp_interface.pyx:384:44: Not all members given for struct 'I
soForest'
warning: isotree\cpp_interface.pyx:384:44: Not all members given for struct 'I
soForest'
warning: isotree\cpp_interface.pyx:387:47: Not all members given for struct 'E
xtIsoForest'
warning: isotree\cpp_interface.pyx:387:47: Not all members given for struct 'E
xtIsoForest'
warning: isotree\cpp_interface.pyx:391:34: Not all members given for struct 'I
mputer'
warning: isotree\cpp_interface.pyx:391:34: Not all members given for struct 'I
mputer'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildT
ools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit
status 2
----------------------------------------
ERROR: Failed building wheel for isotree
Failed to build isotree
ERROR: Could not build wheels for isotree which use PEP 517 and cannot be instal
led directly```
Type the following.
pip install pipwin
pipwin install pycuda

unknown error installing scrapy in pycharm on windows 10

I'm trying to install scrapy in my project virtual environnement in pycharm and i'm having the following error. ( this is the last few lines of the error log it is quite long )
I don't know what is wrong or what to look for.
I tried to install it using the package manager and the pip install scrapy command and the result is the same.
can you help me? thank you and have a nice day!
building 'twisted.test.raiser' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
creating build\temp.win32-3.8\Release\src\twisted
creating build\temp.win32-3.8\Release\src\twisted\test
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -IC:\Users\XXXXX\PycharmProjects\scrapicerie\venv\include -IC:\Python\Python38-32\include -IC:\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" /Tcsrc/twisted/test/raiser.c /Fobuild\temp.win32-3.8\Release\src/twisted/test/raiser.obj
raiser.c
C:\Python\Python38-32\include\pyconfig.h(59): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'io.h'ÿ: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Apparently it had something to do with visual studio.
I reinstalled visual studio with the python and c++ module and now scrapy installed correctly in pycharm.

installing pyGObject has an error in pycharm

while i'm trying to install pyGObject in my Pycharm. it does not work. and has an error :
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe"' failed with exit status 2]
and the output command :
running build_ext
building 'cairo._cairo' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\cairo
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=18 -DPYCAIRO_VERSION_MICRO=0 -IC:\Users\asus\PycharmProjects\Testt\venv\include -IC:\Python34\include -IC:\Python34\include /Tccairo/device.c /Fobuild\temp.win-amd64-3.4\Release\cairo/device.obj
device.c
c:\users\asus\appdata\local\temp\pycharm-packaging\pycairo\cairo\pycairo.h(37) : fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe"' failed with exit status 2
----------------------------------------
my python version is 3.4.8 and working in windows 8.1

can't import python extension

I'm trying to learn python extensions, and I created the simple noddy example c file and setup.py.
python.exe setup.py build gives me:
running build
running build_ext
building 'noddy' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\python27\include -IC:\python27\PC /Tcnoddy.c /Fobuild\temp.win32-2.7\Release\noddy.obj
noddy.c
creating build\lib.win32-2.7
C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\python27\libs /LIBPATH:C:\python27\PCbuild /EXPORT:initnoddy build\temp.win32-2.7\Release\noddy.obj /OUT:build\lib.win32-2.7\noddy.pyd /IMPLIB:build\temp.win32-2.7\Release\noddy.lib /MANIFESTFILE:build\temp.win32-2.7\Release\noddy.pyd.manifest
Creating library build\temp.win32-2.7\Release\noddy.lib and object build\temp.win32-2.7\Release\noddy.exp
C:\Program Files\Microsoft Visual Studio 8\VC\BIN\mt.exe -nologo -manifest build\temp.win32-2.7\Release\noddy.pyd.manifest -outputresource:build\lib.win32-2.7\noddy.pyd;2
I then run python.exe setup.py install, which gives me:
running install
running build
running build_ext
running install_lib
copying build\lib.win32-2.7\noddy.pyd -> C:\python27\Lib\site-packages
running install_egg_info
Writing C:\python27\Lib\site-packages\noddy-1.0-py2.7.egg-info
But then, in Idle,
>>> import noddy
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import noddy
ImportError: DLL load failed: The specified module could not be found.
So, what am I doing wrong? Admittedly, I am horribly confused.
Use the Visual Studio 2008 compiler to build the module.
VS8 is Visual Studio 2005 and the modules compiled with that version are incompatible with Python 2.7 (same applies to modules compiled with Visual Studio 2010 btw.).

Categories

Resources