0

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)

dullarobin's avatar
1
dullarobin
asked 2019-06-14 07:14:40 -0500, updated 2019-06-14 07:18:15 -0500
edit flag offensive 0 remove flag reopen merge delete

Closed for the following reason "the question is answered, right answer was accepted" by dullarobin 2019-06-17 05:48:58 -0500

Comments

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.

drsgao's avatar drsgao (2019-06-14 09:30:18 -0500) edit
add a comment see more comments

1 Answer

0

thanks, @drsgao. After uninstalling and reinstall the openpyxl. It's working fine.

dullarobin's avatar
1
dullarobin
answered 2019-06-17 05:48:29 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments