I pulled mysql-connector-python
code and when I run python ./setup.py build
I get the following error:
Unable to find Protobuf include directory.
pip install Protobuf
was useless
How can I solve this problem?
I pulled mysql-connector-python
code and when I run python ./setup.py build
I get the following error:
Unable to find Protobuf include directory.
pip install Protobuf
was useless
How can I solve this problem?
I am on WIN 7 64-bit, python 27. This command works for me and seems most appropriate, particularly when v2.2.3 is a development version.
I also have this issue on my Ubuntu 16.04 and finally can install mysql-connector 2.2.3 with the following steps:
Install these packages via the Ubuntu package manager:
Set these environment variables:
Install the mysql-connector package via the Python package manager:
Hope this helps.
For some reason I noticed that
pip install mysql-connector
tried to install v2.2.3, which we don't want. Therefore, I specifically enteredpip install mysql-connector==2.1.6
and it installed without error. Please note too that I am using a virtualenv running python 3.6.1. I installed it there. Here is documentation on installing specific python modules that helped me. https://docs.python.org/3/installing/index.htmlI found that this error occurs since version 2.2.3. You can avoid this issue using version 2.1.6.
pip install mysql-connector==2.1.6
try above.
As of 2.2.3, Connector/Python uses a C++ extension that interfaces with a MySQL server with the X plugin enabled, using Protobuf as data interchange format.
So, you need to set up where Protobuf is installed on your system (the library, include and protoc binary paths).
Requirements
Installation
You have two options when using pip + pypi:
1) Set environment variables for
MYSQLXPB_PROTOBUF_INCLUDE_DIR
,MYSQLXPB_PROTOBUF_LIB_DIR
andMYSQLXPB_PROTOC
.2) Add
--install-option
to set these options when using pip:Important: Keep in mind that 2.2.3 is a development release.
On macOS, if you use Homebrew: