I dont know why but today I am unable to import pandas to my project.
import pandas as pd
import tkinter.filedialog
import os
xlfile = tkinter.filedialog.askopenfilenames(filetypes=[("Excel files", ".xlsx .xls")],
title='Select Amazon order file')
df_orders = pd.read_excel(xlfile, header=None)
print(df_orders)
It gives me a traceback
Traceback (most recent call last):
File "C:\Users\...\testtestt.py", line 4, in <module>
import pandas as pd
File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\__init__.py", line 186, in <module>
__version__ = v.get("closest-tag", v["version"])
AttributeError: 'NoneType' object has no attribute 'get'
This is a small extract from pandas\__init__.py
in my system, where the error occurs
from pandas.io.json import _json_normalize as json_normalize
from pandas.util._tester import test
import pandas.testing
import pandas.arrays
# use the closest tagged version if possible
from ._version import get_versions
v = get_versions()
__version__ = v.get("closest-tag", v["version"])
__git_version__ = v.get("full-revisionid")
del get_versions, v
I tried uninstalling pandas and reinstalling it. But no use. Why do I get AttributeError: 'NoneType' object has no attribute 'something'? I guess this is a similar problem. But that doesn't give the solution to my error.