Pycharm gives error "TypeError: 'NoneType' object is not callable"

Viewed 214

On pycharm (2021.2.3) in run mode, its works fine but when I run the project in debug mode I get following exception. I have seen other thread about this problem but since it is old, it didn't work on me: Pycharm gives error "TypeError: 'NoneType' object is not callable" in debug mode for Python-Django Project

Here is my python (Python 3.10.0) code -which is exactly same as there: https://plotly.com/python/ml-regression/

...
X = df[['sepal_width', 'sepal_length']]
y = df['petal_width']

# Condition the model on sepal width and length, predict the petal width
model = SVR(C=1.)
model.fit(X, y)

# Create a mesh grid on which we will run our model
x_min, x_max = X.sepal_width.min() - margin, X.sepal_width.max() + margin
y_min, y_max = X.sepal_length.min() - margin, X.sepal_length.max() + margin
...

and the error:

Traceback (most recent call last):
  File "...\Pricing-x-D-ZXUc\lib\site-packages\numpy\core\getlimits.py", line 649, in __init__
    self.dtype = numeric.dtype(int_type)
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2021.2.3\plugins\python\helpers\pydev\pydevd.py", line 1483, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2021.2.3\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File ".../Dev/Pricing/3d_surface.py", line 16, in <module>
    model.fit(X, y)
  File "...\Pricing-x-D-ZXUc\lib\site-packages\sklearn\svm\_base.py", line 254, in fit
    seed = rnd.randint(np.iinfo("i").max)
  File "...\Pricing-x-D-ZXUc\lib\site-packages\numpy\core\getlimits.py", line 651, in __init__
    self.dtype = numeric.dtype(type(int_type))
TypeError: 'NoneType' object is not callable

Process finished with exit code 1
0 Answers
Related