How can I use Conda to install MySQLdb?

I read a few different explanations regarding how to install MySQLdb, but I'm not sure which case applies to me, as my error message is different. My system cannot find MySQLdb. I installed pymysql, but I need to import MySQLdb to use the procedures from this library.

Thank you for your help.


$ conda install MySQLdb 

Getting package metadata: .... Error: No packages were found in current osx-64 mappings: mysqldb

Did you mean one of them?

 pymysql 

You can find this package on anaconda.org using

 anaconda search -t conda mysqldb $ anaconda search -t conda mysqldb 

Using the anaconda-server api site https://api.anaconda.org Run "anaconda show" to get more information: No packages found Name | Version | Types of Packages | Image Platforms ------------------------- | ------ | --------------- | --------------- 0 packages found

+7
source share
8 answers

You can either return to pip install :

 pip install mysql-python 

or, if there are problems with pip , as in your case, use the binstar package, for example:

 conda install binstar binstar search -t conda mysql-python 

and then conda install -c appropriate package.

+5
source

Try using this command:

 conda install mysql-python 
+19
source

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

 conda install -c bioconda mysqlclient 
+5
source

To install this package with conda running:

 conda install -c anaconda mysql-python=1.2.5 

here: https://anaconda.org/anaconda/mysql-python

+3
source

try the following:

 conda install mysql-connector-python 
+2
source

~ / anaconda2 $ conda install mysql-python

works on ubuntu 16.04

+1
source

On Windows 10 using Python 2.7 or 3+ use this command,

 pip install mysqlclient 

:)

0
source

For Anaconda, Python @StephenRauch offers the right solution, as it is officially supported in the Anaconda Enterprise documentation:

 conda install -c anaconda mysql-connector-python 

Link: https://enterprise-docs.anaconda.com/en/latest/data-science-workflows/data/mysql.html

0
source

Source: https://habr.com/ru/post/1237596/


All Articles