Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Conda to install MySQLdb?

I've read several different explanation regarding how to install MySQLdb, but I'm not sure which case applies to me since my error message is different. My system can't seem to find MySQLdb. I installed pymysql, but i need to import MySQLdb to use procedures from that library.

Thanks for your help.


$ conda install MySQLdb

Fetching package metadata: .... Error: No packages found in current osx-64 channels matching: mysqldb

Did you mean one of these?

pymysql

You can search for this package on anaconda.org with

anaconda search -t conda mysqldb

$ anaconda search -t conda mysqldb

Using anaconda-server api site https://api.anaconda.org Run 'anaconda show ' to get more details: No packages found Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | --------------- Found 0 packages

like image 317
James Eaves Avatar asked Dec 07 '15 18:12

James Eaves


People also ask

How to install MySQL-Python in Anaconda?

You need the Python interface module for MySQL. The Ubuntu package most likely just contains the database itself, and not the Python interface. As Ilan says above/below, just do "conda install mysql-python". when you install a library to use with anaconda, you have to install it with conda .

How do I install a Conda package?

Installing with conda. To install conda packages, in the terminal or an Anaconda Prompt, run: conda install [packagename] During the install process, files are extracted into the specified environment, defaulting to the current environment if none is specified. Installing the files of a conda package into an environment can be thought ...

What version of Python does conda install?

It does not install Python 3. If Python 3.7.0 is currently installed, and the latest version of Python is 3.9.0, then conda install python=3 installs Python 3.9.0.

How do I install mysqldb in Python?

How do I Install MySQLdb in Python? Before proceeding, you make sure you have MySQLdb installed on your machine. Just type the following in your Python script and execute it − If it produces the following result, then it means MySQLdb module is not installed − Note − Make sure you have root privilege to install above module.


2 Answers

Try to use this command:

conda install mysql-python
like image 124
maverik Avatar answered Sep 24 '22 04:09

maverik


For those Googlers in 2018+, you can install from the bioconda channel

conda install -c bioconda mysqlclient
like image 23
WillMonge Avatar answered Sep 24 '22 04:09

WillMonge