AttributeError: module 'openpyxl' has no attribute 'load_workbook' [closed]
I'm a beginner in Python. After installing openpyxl 2.6.2 module using below command in pycharm terminal
pip install openpyxl.
=============CODE========================
from openpyxl import load_workbook
wb = load_workbook('transactions.xlsx')
====================END=======================
ERROR i'm facing
from openpyxl import load_workbook
File "C:\Users\robin.rana\PycharmProjects\HelloWorld\openpyxl.py", line 1, in <module>
from openpyxl import load_workbook
ImportError: cannot import name 'load_workbook' from 'openpyxl'
(C:\Users\robin.rana\PycharmProjects\HelloWorld\openpyxl.py)
I cannot reproduce your error. But it looks strange why your openpyxl.py 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.