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
The CSS position attribute specifies the element&...
Table of contents 1. Introduction 2. Installation...
Problem description: Recently, there is a demand ...
<br /> CSS syntax for table borders The spec...
Generally, during the development process, the su...
Table of contents 1. Understanding the Equality R...
environment: 1. CentOS6.5 X64 2.mysql-5.6.34-linu...
Server placement It is recommended to use cloud s...
In the process of writing HTML, we often define mu...
Flexible layout (Flexbox) is becoming increasingl...
introduction: There are a lot of information and ...
This article example shares the specific code of ...
There were always problems when installing tortoi...
1. MHA By monitoring the master node, automatic ...
By default, setting width for label and span is in...