Ask Your Question
0

AttributeError: module 'openpyxl' has no attribute 'load_workbook' [closed]

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

dullarobin gravatar image

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

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)

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dullarobin
close date 2019-06-17 05:48:58.731411

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 gravatar imagedrsgao ( 2019-06-14 09:30:18 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-06-17 05:48:29 -0600

dullarobin gravatar image

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

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-06-14 07:14:40 -0600

Seen: 5,400 times

Last updated: Jun 17 '19