How to install Python MySQLdb module using pip?

0 votes

How can I install the MySQLdb module for Python using pip?

Aug 20, 2018 in Python by ariaholic
• 7,340 points
90 views

1 answer to this question.

0 votes

It's easy to do, but hard to remember the correct spelling:

pip install mysqlclient

If you need 1.2.x versions (legacy Python only), use pip install MySQL-python

Note: Some dependencies might have to be in place when running the above command. Some hints on how to install these on various platforms:

Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie)

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

Fedora 24:

sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc

Mac OS

brew install mysql-connector-c

if that fails, try

brew install mysql
answered Aug 20, 2018 by charlie_brown
• 7,720 points

Related Questions In Python

0 votes
0 answers

How to install python modules using wheeling format?

Can you show the installation of pyaudio ...READ MORE

Jun 21 in Python by Waseem
• 4,480 points
22 views
+1 vote
1 answer

How to install a module in Python 3.6 ?

If you are using Ubuntu then the ...READ MORE

answered Jun 25 in Python by Arvind
• 2,960 points
85 views
0 votes
1 answer

How to install biopython module in python?

To install biopython on your project, simply ...READ MORE

answered Jul 8 in Python by Mohammad
• 3,060 points
39 views
0 votes
1 answer

How to install tensorflow using anaconda and python 3.7.1 on windows?

Since I am using python 3.5 so ...READ MORE

answered Aug 19 in Python by Arvind
• 2,960 points
117 views
0 votes
2 answers

how to print the current time using python?

print(datetime.datetime.today()) READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
52 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 56,900 points
136 views
0 votes
1 answer
0 votes
1 answer

How to get text label from SAP using pywinauto[python]

Hi. Can you please tell me what ...READ MORE

answered Jun 28, 2018 in Python by Nietzsche's daemon
• 4,260 points
410 views
+2 votes
2 answers

How to make a laplacian pyramid using OpenCV python?

down voteacceptTheeThe problem is that you're iterating ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,720 points
1,526 views
0 votes
1 answer

How to sort Counter by value using python?

Use the Counter.most_common() method, it'll sort the items for you: >>> ...READ MORE

answered May 22, 2018 in Python by charlie_brown
• 7,720 points
1,850 views