SoFunction
Updated on 2024-11-12

How python pip manually installs binary packages

When using pip to install extensions in python, sometimes you will encounter errors like the following:

Running install for mysqlclient ... error
... (Intermediate error messages are omitted.)
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required.
Get it with "Build Tools for Visual Studio": /downloads/

The above error message can be misleading, thinking that Visual C++ 14.0 or higher is required.

In fact, after you install C++, you'll see that the error is still there.

We just have to install themysqlclientYou can really solve the problem.

Manual installation of third-party binary packages

Common third-party package binaries (.whl) downloads:

/~gohlke/pythonlibs/

  1. Search to find mysqlclient
  2. cp38 corresponds to the version of python you have installed, I'm using 3.8 here.
  3. Win32 corresponds to your installation of python as x64 or x86.

I'm using 3.8 and 32 is located is the download to the package name:

  • mysqlclient‑1.4.6‑cp38‑cp38‑

cmd into the location of the project and install it using pip as follows:

pip install 'D:\Program Files\software\mysqlclient-1.4.'

ultimatepip freezeSee that mysqlclient has been installed successfully!

Above is how python pip manually install binary packages in detail, more information about python install binary packages please pay attention to my other related articles!