Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: import has error #59527

Open
2 of 3 tasks
alirezazangi opened this issue Aug 16, 2024 · 3 comments
Open
2 of 3 tasks

BUG: import has error #59527

alirezazangi opened this issue Aug 16, 2024 · 3 comments
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue

Comments

@alirezazangi
Copy link

Pandas version checks

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

  • 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()

@alirezazangi alirezazangi added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 16, 2024
@rhshadrach
Copy link
Member

rhshadrach commented Aug 16, 2024

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

@rhshadrach rhshadrach added Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 16, 2024
@AdrianDeWinter
Copy link

AdrianDeWinter commented Aug 23, 2024

Same issue here:

.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

@rhshadrach
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Needs Info Clarification about behavior needed to assess issue
Projects
None yet
Development

No branches or pull requests

3 participants