Не устанавливается mysqlclient
хотел развернуть свой проект на win10(до этого все делал на ubuntu) но при запуске он не хочет устанавливать mysqlclient. Сам MySql уже установовил и залил данные но понять не могу зачем PyCharm нужны данные от Microsoft Visual C++. Фото прикладываю
так же вот код ошибки .
Ошибка при установки mysqlclient 1.4.4
Здравствуйте. У меня при установке mysqlclient возникла следующая ошибка.
MySql.Data.MySqlClient.MySqlException
Привет. В общем, постараюсь кратко, но понятно обрисовать ситуацию. Только начал изучение создания.
Ошибка подключения к базе MySQL (MySqlClient)
Доброго времени суток. Проблема такая: Не могу подключиться к базе на Mysql сервере. Выбивает.
MySql.Data.MySqlClient Проверка на занятость
Есть некий лист из MySqlConnection холбы найти способ на отслеживание их состояния, для выдачи.
Решение
Неужели так сложно заглянуть сюда, перед тем как устанавливать библиотеку?
Тогда и на форуме не нужно будет очередную бесполезную тему создавать.
Нету там скомпилированной библиотеки для вашей версии Python — вот и весь вопрос.
Добавлено через 1 минуту
Тематические курсы и обучение профессиям онлайн Профессия Python-разработчик (Skillbox) Профессия Fullstack-разработчик на Python (Skillbox) Python-разработчик с нуля (Нетология) Fullstack-разработчик на Python (Нетология) |
На текущий момент для актуальных версий 3.6\3.7\3.8 64-бит (не ОС, а Python) готовые бинарные пакеты присутствуют:
mysqlclient-1.4.6-cp36-cp36m-win_amd64.whl (185.8 kB) | Wheel | cp36 Nov 21, 2019 |
mysqlclient-1.4.6-cp37-cp37m-win_amd64.whl (263.0 kB) | Wheel | cp37 Nov 21, 2019 |
mysqlclient-1.4.6-cp38-cp38-win_amd64.whl (263.1 kB) | Wheel | cp38 Nov 21, 2019 |
Поэтому все устанавливается стандартной командой:
Заказываю контрольные, курсовые, дипломные и любые другие студенческие работы здесь или здесь.
Проблема при добавлении using MySql.Data.MySqlClient
Здравствуйте. Пишу консольное приложение Framework 3.5 возникла проблем при добавлении using.
MySql.Data.MySqlClient.MySqlException:Incorrect string value
Здравствуйте, уважаемые! Без лишних слов, сразу к делу. В-общем, товарищ создал проект на .net.
Где найти библиотеку MySql.Data.MySqlClient на C#?
Я навичок с# немогу найти библатеку сойдинения c# бд mysql 5.0 .
Как из исходников собирать библиотеку для python mysqlclient
Здравствуйте, подскажите пожалуйста как из исходников собирать библиотеку mysql. При обычной.
Modules express не устанавливается или устанавливается криво
Доброго времени суток! Столкнулся с проблемой установки модуля express, Windows 10 1.
pip install mysqlclient with Python 3.8 not working [duplicate]
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:
- 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:
- 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 package(s) do I need to use in order to get the right header files (e.g. mysql.h ) and libraries (e.g. mysqlclient.lib ) for a successful pip install mysqlclient on Windows 7?
- More generally, what are the prerequisites for a successful pip install mysqlclient on Windows 7?
- Download the Oracle MySQL C Connector source code.
- Download and install Microsoft Visual C++ Compiler for Python 2.7.
- Use CMake to generate NMake Makefiles for the MySQL C Connector source code. Pay attention to environment variables, see this Github issue comment.
- Compile the MySQL C Connector mysqlclient library using nmake mysqlclient .
- Install the MySQL C Connector binary and add the compiled mysqlclient.
- Run pip install mysqlclient again.
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!
1 Answer 1
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:
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
pip install mysqlclient error
i’m tryng to import mysqlclient library for python with pip, when i use the command
pip install mysqlclient it return an error:
I’ve already installed Microsoft Build Tools 2015 but the problem persist
10 Answers 10
First install python 3.6.5, then run
You may need to install the Python 3 and MySQL development headers and libraries like so: For UBUNTU or Debian
Red Hat / CentOS
For me, it was a mixture of an old setup tools and missing packages
Try download and install from wheel instead. Take note of your python version and download the correct one.
First try this command
(keep space properly ie, pip space install space —only-binary space :all: space mysqlclient)
pip install —only-binary :all: mysqlclient if still error then try this. Go to this website Python Extension package and press ctrl+F and search mysqlclient. You will find a file name like this.. mysqlclient‑1.4.5‑cp38‑cp38‑win_amd64.whl
Choose carefully —According to python version There is a step given to choose it.
cp38 means for python 3.8 version and cp 37 means for python 3.6 version so first check your python version wether it is 3.8,3.7,3.6,3.5,3.4 then download accordingly.
amd64— while checking python version also check whether your python is of 64-bit or 32-bit. then select accordingly. If your python is of 32-bit then select amd32.
Otherwise you will face problem. Then download the file and install it manually using pip command. There are steps given below:-
After download open command prompt and go to that directory where that downloaded file available( or better to cut that file and paste into your desktop) and type: NOTE :- PLEASE TYPE AFTER DOWNLOAD THE FILE. This is for python 3.8 and 64-bit $ pip install mysqlclient‑1.4.5‑cp38‑cp38‑win_amd64.whl For python 3.7 and 32-bit $ pip install mysqlclient‑1.4.5‑cp37‑cp37m‑win32.whl
Unable to install mysqlclient Python package on Windows
I am trying to install the mysqlclient Python package (https://pypi.python.org/pypi/mysqlclient) into a virtual Python 2.7 environment on Windows 7 (on a local PC, and on the Appveyor CI) and cannot get it done.
I am describing the issues for the local PC with Win 7, but it happens basically the same way on Appveyor.
Packages in my virtualenv when I start:
pip install mysqlclient initially says:
Apparently, Python 2.7 requires VC9. After installing it, pip install mysqlclient gets a little further, but misses include files:
In order to get the header files, I installed the «MySQL Connector/C 6.1.10» from https://downloads.mysql.com/archives/get/file/mysql-connector-c-6.1.10-winx64.msi. This is admittedly only the second latest version, but I need to install it on Appveyor from the command line, and did not find out how to download the latest version in an unattended manner.
Also, using the MSI installer installs the package in C:\Program Files\MySQL\MySQL Connector C 6.1 but the build step in pip install expects it in C:\Program Files (x86)\MySQL\MySQL Connector C 6.1 , so I softlinked it:
When looking at the files in that version of the MySQL Connector/C, it has only lib/vs12 and lib/vs14 directories:
As expected, pip install mysqlclient now gets beyond the compiles, but fails when linking:
I did not find a version of the «MySQL Connector/C» package that can still be downloaded and that works with VC9. Using the mysqlclient.lib files in the vs12 or vs14 directories in this vc9 build results in unresolved symbols.
My questions are:
3 Answers 3
choose the version matching your python version, example mysqlclient‑1.4.2‑cp37‑cp37m‑win_amd64.whl, and then:
Incidentally I ran into the same issue in July last year and only now finished an entry on my blog about it.
Basically, you’re not going to like it, but you need to re-compile mysqlclient from scratch, because — as you pointed out — it’s not available for Visual Studio 9 since a long time.
However, doing it right is somewhat tricky, because you need to fix some compilation issues that apparently aren’t documented anywhere in Oracle’s official documentation. There are also issues with the Python setup.py file, as it doesn’t care about the platform architecture and always looks in the x86 directory. That’s why you soft-linked the directory. There is an open issue on Github mentioning this.
So basically, using the VC++ for Python 2.7 you already installed:
Step 4 is tricky, because Microsoft don’t supply C99 stdint.h, inttypes.h and stdlib.h is missing lldiv_t. You can use this StackOverflow post to get stdint.h and inttypes.h and then manually define lldiv_t in decimal.h as:
You can also copy these headers from a newer Visual Studio, like 2013 and 2015. After that, as you had already figured out, you need to put the compiled mysqlclient.lib into C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib\vs9.
Then issue another pip install mysqlclient and you’re all done.
Installing mysqlclient in Python 3.6 in windows
I want to install MySqlclient on my windows system. I am Currently using Python 3.6. After going through the various post over Stackoverflow, I could Not find the correct way. This is what I have done so far:
1) Installation by using pip pip install mysqlclient . Error:
I already have Microsoft Visual C++ installed on my laptop. Some are saying you need 2015 edition.
2) Installation by using wheel file pip install mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl . Error:
Requirement mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl looks like a filename, but the file does not exist. mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
2.1) Changing the whl file to different version pip install mysqlclient-1.3.13-cp36-cp36m-win32.whl . Error:
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘C:\\Users\\Foxtrot\\Desktop\\finaltest\\mysqlclient-1.3.13-cp36-cp36m-win32.whl’
Other things that are done: updated setuptools, updated wheel.
9 Answers 9
I can’t find mysqlclient-1.3.13’s whl file on PyPi. So you need to compile it from source. Unfortunately it’s not easy. I’m not Windows guy, so I only can recommend guide like this
Had the same problem, searched the web etc. Here this answer:
It has all the instructions. In short go to this site: https://www.lfd.uci.edu/
There you will find mysqlclient‑1.3.13‑cp36‑cp36m‑win32.whl mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl
Download the correct file for your platform.
Then use your downloaded wheels file with pip and your done:
pip install c:\mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl
gohlke/pythonlibs has lots of lots of compiled libaries to solve the problem of building them from source yourself. They even compile them for python 3.7 🙂
Alternative Solution
You can also download Visual C++ Build Tools and then you should be able to install every (at least to my knowledge) version of mysqlclient with pip. To do this go to this site: https://www.scivision.co/python-windows-visual-c++-14-required/ there you can find out which version of Build Tools you need and you can also find a link to download the installer. Be aware though Build Tools require more than 4GB of free disk space.
I am using python3.7 on Windows 10 operating system. I had same issue and after a long research I had installed it successfully.
Install «Microsoft Visual C++ Build Tools» AND My OS is having 64 bit operating system but still then it need to install 32 bit version «mysqlclient‑1.4.2‑cp37‑cp37m‑win32.whl»
pip install [path_to_downloaded_file] eg: C:\Users\Ds\mysqlclient-1.4.2-cp37-cp37m-win32.whl
use pipenv instead of pip if you are using virtual environment.
The error means that the package has not yet been compiled for your versions of OS and Python. So pip tries to build it from the source for you.
There are two possible solutions.
The first option is to install the most recent version of Microsoft Visual C++ Build Tools. Just go ahead and download it from the Microsoft website. Then pip should be able to compile the package.
Another option is using an unofficial binary. As mentioned here, a resource proved to be useful is https://www.lfd.uci.edu/
gohlke/pythonlibs/#mysql-python . Just download the pre-compiled package and install it using
pip install c:\path-to-a-pre-compiled-package
Tell pip not to use sources and use binary packages instead:
Had the same problem just day. Tried to install mysqlclient on a Windows Server R2.
«MySQL Connector C 6.1» was installed in the wrong directory: «C:\Program Files\MySQL» instead of «C:\Program Files (x86)\MySQL» where it should be for me.
—> Copied «MySQL Connector C 6.1» to «C:\Program Files (x86)\MySQL» Directory.
«C:\Users\MoBoo\AppData\Local\Temp» was Read-Only: Therefore pip couldn’t compile files into Temp dir.
—> Allow Write access to «C:\Users\MoBoo\AppData\Local\Temp» Directory.
Here is what worked for me. I uninstalled mysql and re-installed it.
Then simply re-install, so it picked the current version «1.4.2.post1»
Which interestingly, works straightaway.
for this error, most of user’s suggest to install vs build but there is an alternative which works perfectly in my case and is sure for you too. Download latest MySQL client from here mysqlclients
Here you can see many version but prefer to download the latest one which has 32 bit and 64-bit files. download theme and past the file on your projects root folder then run the same command but with the full file name of downloaded mysqlclient.
in my case, the file is this also if have already the XAMPP server then you can use its PHPMyAdmin with python. You just need to change on your roots setting.py file for this. Something like this
The port is the same which you see on xampp panel just before the start button of MySQL. After changing this you just again start your server by hitting this command
If you didn’t see any error then congratulations you successfully connected with MySQL database.