Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In debug, using pandas before importing from Scipy generates Type error on import

When run in debug in PyCharm 2021.3 (Community Edition) on Mac, the code:

import pandas as pd
x = pd.DataFrame()
from scipy.stats import poisson

Generates the exception:

...
  File "/.../venv/lib/python3.10/site-packages/numpy/core/getlimits.py", line 518, in __init__
    self.dtype = numeric.dtype(type(int_type))
TypeError: 'NoneType' object is not callable

(the None variable is numeric.dtype)

Python 3.10.0
dependencies: pip install numpy==1.21.2 pandas==1.3.5 scipy==1.7.3

like image 875
chikchakchok Avatar asked Nov 15 '25 14:11

chikchakchok


1 Answers

This is a known (but not solved) issue; see pandas issue 41935 on github. Some comments there suggest it might be a Python or Cython bug.

like image 192
Warren Weckesser Avatar answered Nov 18 '25 05:11

Warren Weckesser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!