No module named PyMySQL

1,910 views
Skip to first unread message

LO Yi

unread,
May 22, 2018, 7:48:24 PM5/22/18
to PyMySQL Users
Hey, all!

I have a problem with importing PyMySQL. So, I did install PyMySQL by

pip3 install PyMySQL

when I tried to import PyMySQL

import PyMySQL

An error showed up said "ImportError: No module named PyMySQL" when running the code.

I then checked if PyMySQL had successfully installed or not by

pip3 list

"PyMySQL    0.8.1 " showed up on the list.

What is the next thing I need to check in order to get the code work.

I am using a MacBook with MacOS10.13.4

Thanks in advance!

INADA Naoki

unread,
May 22, 2018, 7:52:29 PM5/22/18
to pymysq...@googlegroups.com
import pymysql

Use lowercase.

2018年5月23日(水) 8:48 LO Yi <yiiiii...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "PyMySQL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymysql-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

LO Yi

unread,
May 23, 2018, 7:07:26 PM5/23/18
to pymysq...@googlegroups.com
no, it doesn't work, the error remain the same.
Do I have to install something else to support pymysql? I was thinking I need to set up MySQL locally, but it doesn't make sense.

import pymysql

Use lowercase.

To unsubscribe from this group and stop receiving emails from it, send an email to pymysql-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PyMySQL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymysql-users+unsubscribe@googlegroups.com.

INADA Naoki

unread,
May 23, 2018, 8:26:50 PM5/23/18
to pymysq...@googlegroups.com
On Thu, May 24, 2018 at 8:07 AM LO Yi <yiiiii...@gmail.com> wrote:

> no, it doesn't work, the error remain the same.
> Do I have to install something else to support pymysql? I was thinking I
need to set up MySQL locally, but it doesn't make sense.


No.

You need to verify your environment.

* All other modules your installed via `pip3 install` can be import?
* What `python3 -m site` and `pip3 -V` shows?
* Uninstall and install pymysql again?
* What about `python3 -m pip install pymysql`?

Anyway, it must not PyMySQL issue, but your environment issue.
Stackoverflow is your friend.

--
INADA Naoki <songof...@gmail.com>
Reply all
Reply to author
Forward
0 new messages