Pandas version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pandas.

  • [X] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
data = pd.read_excel('sheet_path', 'sheet_name', dtype={'col1':str})

Issue Description

When I try to execute the code I receive an error: TypeError: read_excel() got an unexpected keyword argument 'dtype'

Expected Behavior

I expect that this keyword, as explained in the documentation, permit to define the datatype of a column that now is read as numeric integer but I need to read it as string.

Installed Versions

INSTALLED VERSIONS ------------------ commit : 2e218d10984e9919f0296931d92ea851c6a6faf5 python : 3.10.4.final.0 python-bits : 64 OS : Windows OS-release : 10 Version : 10.0.22000 machine : AMD64 processor : Intel64 Family 6 Model 140 Stepping 1, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : Italian_Italy.1252 pandas : 1.5.3 numpy : 1.22.3 pytz : 2022.1 dateutil : 2.8.2 setuptools : 61.2.0 pip : 21.2.4 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : 4.9.1 html5lib : None pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : None pandas_datareader: None bs4 : None bottleneck : None brotli : None fastparquet : None fsspec : 2023.1.0 gcsfs : None matplotlib : 3.6.2 numba : None numexpr : None odfpy : None openpyxl : 3.0.9 pandas_gbq : None pyarrow : 10.0.1 pyreadstat : None pyxlsb : None s3fs : None scipy : 1.8.0 snappy : None sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None xlwt : None zstandard : None tzdata : 2022.7

Comment From: phofl

Hi, thanks for your report.This works for me on 1.5.3. Can you check the function signature in your installation and provide the file?

Comment From: marcomameli1992

Hi, how can I check the function signature?

I have tested my code with macos and windows, both with 1.5.3 and the result is the same.

Thanks

update. I hope that is what you ask:

'DataFrame | dict[IntStrT, DataFrame]'>

Comment From: phofl

Yeah, not sure what's wrong on your side. Can you try reinstall?

Comment From: marcomameli1992

I try to remove the pack, clean the cache and install it again bu the problem persist.

Comment From: marcomameli1992

Dear @phofl, do you have any suggestions to solve the problem?

Edit: I try to create a new environment with conda and I have installed pandas library with conda but the problem with dtype is not solved

Comment From: phofl

I'd suggest asking on stack overflow. Not sure what's wrong on your side. We have a bunch of tests covering this and this isn't broken on my machine either. So seems to me as this is something with your environment

Comment From: marcomameli1992

I ask on stack overflow. Here the link: stackoverflow

I hope that someone has a solution to this problem.

thankyou

Comment From: phofl

closing for now