thesisstudent
thesisstudent

Reputation: 119

Python 3.4 (Anaconda) - MySQL connector

I installed Python 3.4 by installing Anaconda. Now I would like to read data out of a MySQL database from Python. Hence I tried installing the Connector/Python 2.0.3 (https://dev.mysql.com/downloads/connector/python) for Python 3.4.

After it finishes downloading, it says "Python v3.4 not found". I looked it up online and came to the conclusion that something might be wrong with my environment variables. When copy pasting the location of IPython (in the Anaconda folder), i.e. C:\Users\Julie\Anaconda3\python.exe "C:\Users\Julie\Anaconda3\Scripts/ipython-script.py", as the PATH variable, I still get the same problem.

Does anybody know how to resolve this? Thank you in advance!

Upvotes: 3

Views: 20896

Answers (3)

sparrow
sparrow

Reputation: 11460

First go to the location of your conda.exe, for me it's:

cd C:\Program Files\Anaconda3\Scripts

Then install the package:

conda.exe install mysql-connector-python

Upvotes: 6

ostrokach
ostrokach

Reputation: 19982

PyMySQL does not support Python 3. Install [mysqlclient-python] (https://github.com/PyMySQL/mysqlclient-python) instead:

sudo apt-get install libmysqlclient-dev 
pip install mysqlclient

Upvotes: 0

SciGuyMcQ
SciGuyMcQ

Reputation: 1043

I had a similar problem (except using 2.7). The following solution worked.

http://www.reddit.com/r/Python/comments/33i99j/does_anyone_know_how_to_install_mysqldb_with/

Basically go to your scripts directory within the anaconda directory and type the following into your command prompt: conda.exe install mysql-python

Upvotes: 1

Related Questions