简体   繁体   中英

python - pip install mysqlclient on Arch Linux

I need to use MySQLdb in Python 3.7:

import MySQLdb

this should install through the command pip install mysqlclient which however gives me an error on Arch Linux. It seems prerequisites are missing. I see that on other distributions, like Ubuntu, these can be installed via the command:

sudo apt-get install python-dev default-libmysqlclient-dev

Solutions are available for other distro, but I could not find them for Arch Linux.

Does it work through pacman? pacman -S python-mysqlclient

In the end the solution was to install gcc and mysql

pacman -S gcc

pacman -S mysql 

and just later run

pip install mysqlclient

如果您使用 pacman 安装“python-mysqlclient”,那么您可以毫无问题地安装它。

  1. pacman -S python-mysqlclient
  2. pip install mysqlclient

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM