Python Forum
openpyxl workbook module not callable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
openpyxl workbook module not callable
#1
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
Reply
#2
try
from openpyxl import Workbook
wb = Workbook()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Thanks BURAN I had mostly seen the W but had missed the import Workbook always!
Now no problem !
Reply
#4
Responding belatedly to buran

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

Docwat
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to copy work sheet data one workbook to other? sayyedkamran 2 645 Nov-03-2023, 09:10 AM
Last Post: Larz60+
  xlwings error when reading a workbook Mishal0488 1 1,036 Aug-01-2023, 02:05 AM
Last Post: deanhystad
  Openpyxl module breaking my code EnderSM 5 985 May-26-2023, 07:26 PM
Last Post: snippsat
  Merge htm files with shutil library (TypeError: 'module' object is not callable) Melcu54 5 1,492 Aug-28-2022, 07:11 AM
Last Post: Melcu54
  Help in opening and editing an excel workbook from a web-browser test 4 1,357 Aug-10-2022, 02:31 PM
Last Post: test
  TypeError: 'module' object is not callable SyamPothan 4 4,534 Mar-04-2022, 04:44 PM
Last Post: SyamPothan
  'module' object is not callable Racer_x 5 2,637 Nov-04-2021, 03:20 PM
Last Post: Racer_x
  Add a new column when I extract each sheet in an Excel workbook as a new csv file shantanu97 0 2,190 Mar-24-2021, 04:56 AM
Last Post: shantanu97
  [split] openpyxl workbook module not callable yosoyebj 1 2,739 Sep-14-2020, 10:18 AM
Last Post: buran
  Facing issue while saving workbook Abhisht 3 5,503 Aug-19-2020, 11:44 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020