#πŸ”’ Trying to import excel sheet and turn it into tuples within a list

11 messages Β· Page 1 of 1 (latest)

novel coveBOT
#

@wind cliff

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

rose sable
#

When you want help with errors, always make sure to mention the errors.

wind cliff
#

i forgot to add but the error does not occur when i read a csv file

wind cliff
#

Error message since my other message is too long

File "/Users/jaskeatsingh/PycharmProjects/pythonProject4/venv/lib/python3.11/site-packages/pandas/compat/_optional.py", line 135, in import_optional_dependency
    module = importlib.import_module(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'openpyxl'



Traceback (most recent call last):
  File "/Users/jaskeatsingh/PycharmProjects/pythonProject4/Punjabi Numbers/Testing.py", line 9, in <module>
    numfile = pd.read_excel("/Users/jaskeatsingh/Documents/python punjabi/Book2.xlsx")
              
  File "/Users/jaskeatsingh/PycharmProjects/pythonProject4/venv/lib/python3.11/site-packages/pandas/io/excel/_base.py", line 495, in read_excel
    io = ExcelFile(
         ^^^^^^^^^^
  File "/Users/jaskeatsingh/PycharmProjects/pythonProject4/venv/lib/python3.11/site-packages/pandas/io/excel/_base.py", line 1567, in __init__
    self._reader = self._engines[engine](
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaskeatsingh/PycharmProjects/pythonProject4/venv/lib/python3.11/site-packages/pandas/io/excel/_openpyxl.py", line 552, in __init__
    import_optional_dependency("openpyxl")
  File "/Users/jaskeatsingh/PycharmProjects/pythonProject4/venv/lib/python3.11/site-packages/pandas/compat/_optional.py", line 138, in import_optional_dependency
    raise ImportError(msg)
ImportError: Missing optional dependency 'openpyxl'.  Use pip or conda to install openpyxl.
rose sable
#

ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.

wind cliff
#

omg thank you, i literally jsut found the probelem on github😭

#

thank you

rose sable
#

You're welcome. When in doubt, reread the error. They often tell you exactly what the problem is.

novel coveBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.