简体   繁体   中英

ModuleNotFoundError: No module named 'PyMySQL'

I have successfully installed PyMySQL in my Ubuntu 16.04 OS using pip command:

debarati@debarati-hp:~$ pip install PyMySQL
Collecting PyMySQL
  Downloading PyMySQL-0.8.0-py2.py3-none-any.whl (83kB)
    100% |████████████████████████████████| 92kB 159kB/s 
Installing collected packages: PyMySQL
Successfully installed PyMySQL-0.8.0

Still when I am trying to execute a Python file called view_rows.py , it's giving the following error:

debarati@debarati-hp:~$ python view_rows.py
Traceback (most recent call last):
  File "view_rows.py", line 5, in <module>
    import PyMySQL
ModuleNotFoundError: No module named 'PyMySQL'

But, this does not give any error:

debarati@debarati-hp:~$ import PyMySQL 

This is my Python version:

debarati@debarati-hp:~$ python -V
Python 3.6.3 :: Anaconda custom (64-bit)

The package name is "PyMySQL"; you use the package name to install it. To use the installed package, you need to use the module name, which may not be the same. In this case, the module is named "pymysql" (all lower-case).

The import should be import pymysql .

https://pymysql.readthedocs.io/en/latest/py-modindex.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM