This question already has answers here:
pip install mysqlclient returns "fatal error C1083: Cannot open file: 'mysql.h': No such file or directory
(18 answers)
Closed 2 years ago.
I have a django project with Python 3.8 and I am trying to install mysqlclient library through: pip install mysqlclient command. I got this error:
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
I tried installation by using wheel file from where ( I tried every wheel from this site ) but I got the error: *...is not a supported wheel on this platform.*
I tried to install it from the source but when I run this command python setup.py install I got the same error:
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
I tried this command pip install --only-binary :all: mysqlclient and I got the error:
Could not find a version that satisfies the requirement mysqlclient (from versions: )
No matching distribution found for mysqlclient
Please let me know if you have some suggestions. Thank you!
Cannot open include file: 'mysql.h': No such file or directory
You are missing the mysql library that is needed as a requirement when compiling mysqlclient from source.
is not a supported wheel on this platform
I bet you have a 32-bit python installed. All the whl files for mysqlclient on pypi are for amd64, which would explain why there is no supported version for your setup. You can check by:
Check your installation path, if it contains something like python38-32, then you have the 32 bit version for sure
Type python in the cmd and check the first line. For me (64 bit python), it contains the string MSC v.1915 64 bit (AMD64)
What you can do about it is uninstall the 32 bit version and install the 64 bit one, after all mysqlclient will not be the last tool that does not have 32 bit whl files available on pypi OR you could download the 32 bit whl file for mysqlclient from here
Related
I'm trying to install python-rocksdb on a windows 10 machine and I'm coming across some issues with the install.
I have successfully installed rocksdb first using the vcpkg method.
When running pip install python-rocksdb I get the following error:
cl : Command line error D8021 : invalid numeric argument '/Wextra'
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Looking around suggested attempting to install with GCC or G++, so I downloaded cygwin and then attempted to install the python package using
pip install --global-option build_ext --global-option --compiler=cygwin python-rocksdb which yielded the following error:
gcc: error: unrecognized command-line option ‘-mcygwin’
error: command 'C:\\cygwin64\\bin\\gcc.exe' failed with exit code 1
This post seems to suggest that you need to use g++ specifically, but it looks like the cygwin command is defaulting to gcc.
Just note that I'm not using the virtual env with python.
Any assistance is greatly appreciated.
I've created a python package that uses lxml.
In setup.py I have defined:
packages=find_packages(), # Required
python_requires='>=3.8, <4',
install_requires=[
'typer[all]',
'packaging',
'lxml'
]
Tests, packaging and deployments work just fine.
However, after uploading the package to my company's PyPi repository, I'm trying to install the package with:
pip install -i <mypypirepo> <mypackage>
I get the a long error including:
fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python39\python.exe'
While trying to install manually the lxml I get the same exact error.
I found solutions on stackoverflow that talk about manually downloading a compatible wheel version of lxml and then installing it with pip.
However, the lxml is a part of the package that should be easily installed by the end-user.
Is there any way to solve the issue without forcing the user to manually install lxml?
Note: This issue only started happening after upgrading python from 3.8 to 3.9.
As of this writing 2020-10-12 there is no lxml wheel for python 3.9 on PyPI.
If using windows like I do there are unofficial wheels here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
I have been trying for 3 days to install this library. It uses CMake and i can't understand how to add OpenCV path within visual studio. I have tried a lot of things like:
1.use CMake-GUI to generate .sln file then build there is also an error.
2.try to add through cmd with CMake but there I face another error.
I believe there is a simple way of directly doing it through visual studio which I am unfamiliar of and can't seem to find it. If someone is kind enough to tell me in simple way how to install library using visual studio python 3.6.
Here is the error I get in VS 2017 after I try to install pybgs library through pip install pybgs
ERROR: Failed building wheel for pybgs
Failed to build pybgs
Installing collected packages: pybgs
Running setup.py install for pybgs: started
Running setup.py install for pybgs: finished with status 'error'
ERROR: Command errored out with exit status 1:
CMake Error at CMakeLists.txt:113 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
I am trying to install for python (anaconda, windows) package: "fbprofit".
At the first stage I've got error: Microsoft Visual C++ 14.0 is required - error - pip install fbprophet
but now it seems to be resolved (thanks to SO), and there is another error:
c:\work\anaconda3\include\pyconfig.h(59): fatal error C1083: ?? г¤ ?вбп RвЄа
лвм д c< ўЄ<оз?-Ё?: io.h: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\B
IN\\x86_amd64\\cl.exe' failed with exit status 2
I see that there are many similar questions here for different python packages under windows.
Still I cannot get the solution.
I tried:
1) Launching pip install from Visual Studio 2017/Visual Studio Tools/ command promt - otherwise (from other "cmd") I got another error.
(That is suggested: https://stackoverflow.com/a/45918595/625396 - that seems good idea !)
2) https://stackoverflow.com/a/44563421/625396
That does not seems to have any effect, strangely it worked for many people
3) https://github.com/sammchardy/python-binance/issues/148
Here is suggested to download precompiled wheels,
I have installed relevant to my machine: Twisted‑18.7.0‑cp36‑cp36m‑win_amd64.whl
but it does not have an effect
I ran the command line to install lxml but then it gave me this error:
C:\Users\username\AppData\Local\Temp\easy_install-y6y867l_\lxml-3.5.0\temp\xmlXPathInit67jlgy6a.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
Error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
I also have MVC intstalled already. Any help would be greatly appreciated!
Just install Anaconda, It contains many libraries, including lxml.
Run this
set STATICBUILD=true && pip install lxml
And these dependencies will be downloaded and build together by the installer:
libxslt
iconv
zlib
libxml2
Or you can download the .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml and install it by
pip install lxml‑3.5.0‑cp27‑none‑win32.whl
If it doesn't work,check this.
lxml-install-on-windows-7-using-pip-and-python-2-7
Hope this helps.