Reputation: 15
I've looked at other similar issues, but all my paths seem to be fine. I tried to install the python mysql library in conda so I could use it. To all metrics, it seems installed and recognized in the Pycharm interpreter, and when running conda list
, I see mysql
as an installed library, yet any time I try to import it, I get a ModuleNotFoundError
. See below for a sample:
To isolate the issue, I chose to install another well known package that was not previously on my env, tenserflow
, here's the results of that:
Evidently the issue is with the mysql
library, since tensorflow
installed and functioned as expected, meaning this isn't an issue with the interpreter, or an incorrect python path, or probably even conda.
I'm at a loss to what the issue is. I have mysql server installed, though that shouldn't matter, and I only have one environment. I'm trying to connect to a db, and have never used any mysql libraries on Python, so if there's others can be recommended, I have no preference, I just want my db!
Thanks in advance!
Upvotes: 0
Views: 1740
Reputation: 20600
You have only installed the c library mysql
, not the python library that you were looking for.
You need to do
conda install -c conda-forge mysql-connector-python
which will install the mysql
python module that you are looking for
Upvotes: 2