Python Forum

Full Version: openpyxl workbook module not callable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I have pip installed openpyxl under Python 3.7 and cannot run this:

>>>from openpyxl import workbook
>>>
>>>wb = workbook()
Traceback : File "stdin", line 1, in <module.
TypeError: 'module' object is not callable
>>>

Indeed no attributes appear to be functional.---> ws = wb.active --> ws.title =" A " warns ws does ont have title attribute

I have pip uninstalled and re-installed many times but simply cannot get openpyxl to work. I have pip installed several other modules which work (such as Link Labs CONDUCTOR). PYTHON is entirely new to me. I can get xslwriter to wok fine but I need a clean wb.save of openpyyxl in order to put it in a multiple attempt loop to access a file which may be busy and wait until it is free. Clearly I am missing something with openpyxl install !

I would welcome any advice.

Docwat
try
from openpyxl import Workbook
wb = Workbook()
Thanks BURAN I had mostly seen the W but had missed the import Workbook always!
Now no problem !
Responding belatedly to buran

Thanks buran. Yes I was looking for greater problems and missed my misstype ! Appologies

Docwat