[PYTHON] What to do if you can't pip install mysqlclient

environment

macOS Catalina 10.15.5
pipenv 2020.6.2
Homebrew 2.4.3

error

When I tried to install mysqlclient, I got a long, long error message and couldn't install it.

$ pipenv install mysqlclient==1.4.6

.
.
.
ERROR: Couldn't install package: mysqlclient

I got this

Install mysql-connector-c

$ brew install mysql-connector-c

Show openssl package information

$ brew info openssl

[email protected]: stable 1.1.1g (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/[email protected]/1.1.1g (8,059 files, 18MB)
  Poured from bottle on 2020-05-03 at 16:19:23
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/[email protected]/certs

and run
  /usr/local/opt/[email protected]/bin/c_rehash

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> /Users/Your home directory/.bash_profile

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

For pkg-config to find [email protected] you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

==> Analytics
install: 583,299 (30 days), 2,291,367 (90 days), 6,244,922 (365 days)
install-on-request: 72,656 (30 days), 337,989 (90 days), 825,813 (365 days)
build-error: 0 (30 days)

Execute the following three displayed by the above command

  $ echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> /Users/Your home directory/.bash_profile
  $ export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  $ export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

reference

https://stackoverflow.com/questions/35190465/virtualenvpython3-4-pip-install-mysqlclient-error

Recommended Posts

What to do if you can't pip install mysqlclient
What to do if you can't install pyaudio with pip #Python
What to do if you can't install with pip in babun environment
What to do if pip install mysqlclient fails on MacOS
What to do if you can't pipenv shell
Note: What to do if pip install fails
What to do if you get a UnicodeDecodeError with pip install
What to do if pip install fails in Xcode 5.1
What to do if pip install fails to install dependent libraries
What to do if you can't sort files with subscripts
What to do if `pip install matplotlib` fails on Mac
What to do if you can't log in as root
What to do if you can't use WiFi on Linux
How to install and use pyenv, what to do if you can't switch python versions
What to do if you can't build your project with Maven
What to do if you can't use the trash in Lubuntu 18.04.
What to do if pip cannot be installed
What to do if you can't find well with grep's -f option
What to do if you can't find PDO in Laravel or CakePHP
What to do if you can't use scikit grid search in Python
What to do if you get Could not fetch URL 443 with pip
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
What to do if a UnicodeDecodeError occurs in pip
What to do when you can't bind CaboCha to Python
What to do if yum breaks
What to do with Magics install
[AWS] What to do when you want to pip with Lambda
What to do if you are addicted to Windows character code
What to do if pip gives a DistributionError in Homebrew
What to do if you get "coverage unknown" in Coveralls
What to do if you lose your EC2 key pair
What to do if you can't hit the arrow keys in the Python interactive console
What to do if you get a minus zero in Python
I was addicted to pip install mysqlclient
[TensorFlow] If you want to run TensorBoard, install it with pip
What to do when you get "I can't see the site !!!!"
Let's summarize what you want to do.
What to do if you get an Undefined error when trying to use pip with pyenv
What to do if you couldn't send an email to Yahoo with Python.
What to do if you forget your login password on Manjaro Linux
What to do if you get lost in file reference with FileNotFoundError
What to do if you get angry in TensorFlow v2 without attribute'app'
What to do if you get stuck during Anaconda installation on Linux
What to do if pyenv install does not proceed with an error
What to do if you get a TypeError with numpy min, max
What to do if you get an error when trying to load mnist
What to do if you get an error when installing Dlib (Ubuntu)
What to do if pipreqs results in UnicodeDecodeError
What to do if mod_fcgid cannot resolve UnicodeEncodeError
What to do if rails s doesn't work
What to do if atom autocomplete-python doesn't work
What to do if Docker-sync suddenly stops working
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
EC2 / Amazon Linux2: What to do if you get an "unable to execute'gcc': No such file or directory" error with pip install
How to install pip
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if you get a "No versions found" error in pipenv
What to do if you get angry with swapon failed: Operation not permitted
What to do if scrapy doesn't work after installing scrapy with pip on mac
What to do if Django can't load an image from a static folder