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.

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

Reproducible Example

---> 62 from pandas.core.api import (
     63     # dtype
     64     ArrowDtype,
     65     Int8Dtype,
     66     Int16Dtype,
     67     Int32Dtype,
     68     Int64Dtype,
     69     UInt8Dtype,
     70     UInt16Dtype,
     71     UInt32Dtype,
     72     UInt64Dtype,
     73     Float32Dtype,
     74     Float64Dtype,
     75     CategoricalDtype,
     76     PeriodDtype,
     77     IntervalDtype,
...
File hashtable.pyx:1, in init pandas._libs.hashtable()

File missing.pyx:40, in init pandas._libs.missing()

AttributeError: partially initialized module 'pandas' has no attribute '_pandas_datetime_CAPI' (most likely due to a circular import)

Issue Description

AttributeError Traceback (most recent call last) Cell In[2], line 1 ----> 1 import pandas as pd

Expected Behavior

AttributeError Traceback (most recent call last) Cell In[2], line 1 ----> 1 import pandas as pd

Installed Versions

Replace this line with the output of pd.show_versions()

Comment From: rhshadrach

Can you show how you installed pandas, and the output from the command used to install it.

Comment From: AdrianDeWinter

Same issue here: import pandas as pd .3.12\Lib\site-packages\pandas\__init__.py:62: in <module> from pandas.core.api import ( .3.12\Lib\site-packages\pandas\core\api.py:1: in <module> from pandas._libs import ( .3.12\Lib\site-packages\pandas\_libs\__init__.py:18: in <module> from pandas._libs.interval import Interval interval.pyx:1: in init pandas._libs.interval ??? hashtable.pyx:1: in init pandas._libs.hashtable ??? missing.pyx:40: in init pandas._libs.missing ??? E AttributeError: partially initialized module 'pandas' has no attribute '_pandas_datetime_CAPI' (most likely due to a circular import)

Installed it via pip: pip install -r requirements.txt

Wiith the relevant line in the requirements file being: pandas~=2.2.2

~~While searching, i found some references to this and similar problems being resolved by setting the system locale to en_US, mine is de_DE. Unfortunately, i can not (easily) change it to test that~~ Strike that, i just ran the same tests inside a docker container set to en_US and got the same errors

Comment From: rhshadrach

@alirezazangi - can you include the output from the installation of pandas?

Comment From: dakshsinghal2003

@rhshadrach Im also facing the same issue , my python version is : Python 3.11.9 upon installing pandas , the following output was there in the terminal :

(venv) C:\python_projects\campaing>pip install pandas Collecting pandas Using cached pandas-2.2.3-cp311-cp311-win_amd64.whl.metadata (19 kB) Requirement already satisfied: numpy>=1.23.2 in c:\python_projects\campaing\venv\lib\site-packages (from pandas) (1.26.4) Requirement already satisfied: python-dateutil>=2.8.2 in c:\python_projects\campaing\venv\lib\site-packages (from pandas) (2.9.0.post0) Requirement already satisfied: pytz>=2020.1 in c:\python_projects\campaing\venv\lib\site-packages (from pandas) (2024.2) Requirement already satisfied: tzdata>=2022.7 in c:\python_projects\campaing\venv\lib\site-packages (from pandas) (2024.2) Requirement already satisfied: six>=1.5 in c:\python_projects\campaing\venv\lib\site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0) Using cached pandas-2.2.3-cp311-cp311-win_amd64.whl (11.6 MB) Installing collected packages: pandas Successfully installed pandas-2.2.3

Comment From: 1357310795

same problem here.

But I'm using jupyter notebook. I encountered this error by starting the jupyter kernel first and then installing pandas. I think restarting the computer after installation can solve all problems

Comment From: mroeschke

Sounds like an installation issue so closing