Try installing via pip in a virtual environment: pip install mysqlclient Then an error is reported: OSError: mysql_config not found Found the official document https://github.com/PyMySQL/mysqlclient-python, explaining that another module needs to be installed before installation: brew install mysql-connector-c But the error: Check the error message and install mysql-connector-c before brew unlink mysql But continue to install or error: Check the official instructions, it turns out that under macOS, you need to change the value in mysql_config # on macOS, on or about line 112: # Create options libs="-L$pkglibdir" libs="$libs -l " Change to # Create options libs="-L$pkglibdir" libs="$libs -lmysqlclient -lssl -lcrypto" Next is easy, directly which mysql_config Find the file path, move to that path, modify the content with vim, exit and re-execute pip install mysqlclient It succeeded. In fact, there are other modules for connecting to MySQL under Python, such as pymysql, etc., which are not so troublesome to install on Mac. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Mini Program to Implement the Complete Shopping Cart
This article shares the installation steps of MyS...
Copy code The code is as follows: <!DOCTYPE ht...
Install Filebeat has completely replaced Logstash...
Preface When I was studying the front end before,...
Last weekend, a brother project was preparing to ...
Table of contents Overview Checking setTimeout() ...
The computer system has been reinstalled, and the...
//Default protocol /The use of the default protoc...
Background Controller @RequestMapping("/getP...
When the Docker container exits, the file system ...
WeChat applet trajectory playback mainly uses pol...
Table of contents First of all, you need to know ...
This article introduces the installation of Windo...
Parent File import React, { useState } from '...
Using UNION Most SQL queries consist of a single ...