AttributeError: module 'openpyxl' has no attribute 'load_workbook'

asked 2019-06-14 07:14:40 -0500

dullarobin gravatar image

updated 2019-06-14 07:18:15 -0500

I'm a beginner in Python. After installing openpyxl 2.6.2 module using below command in pycharm terminal

pip install openpyxl.


from openpyxl import load_workbook

wb = load_workbook('transactions.xlsx')


ERROR i'm facing

from openpyxl import load_workbook

File "C:\Users\robin.rana\PycharmProjects\HelloWorld\", line 1, in <module>

from openpyxl import load_workbook

ImportError: cannot import name 'load_workbook' from 'openpyxl'


edit retag flag offensive close merge delete


I cannot reproduce your error. But it looks strange why your is in your personal folder instead of the ../site-pacakges/ dir. By the way, try not to use Pycharm but run the script directly using cmd. Also, for such questions, try stack overflow instead of here.

drsgao gravatar imagedrsgao ( 2019-06-14 09:30:18 -0500 )edit