No module named 'pymysql'

后端 未结 14 1734
清酒与你
清酒与你 2020-12-15 02:32

I\'m trying to use PyMySQL on Ubuntu.

I\'ve installed pymysql using both pip and pip3 but every time I use import pymysq

14条回答
  •  抹茶落季
    2020-12-15 02:55

    I also got this error recently when using Anaconda on a Mac machine.

    Here is what I found:

    1. After running python3 -m pip install PyMySql, pymysql module is under /Library/Python/3.7/site-packages
    2. Anaconda wants this module to be under /opt/anaconda3/lib/python3.8/site-packages

    Therefore, after copying pymysql module to the designated path, it runs correctly.

提交回复
热议问题